简体   繁体   English

弹性 APM 错误 | 谷歌 Kubernetes 引擎

[英]Elastic APM Error | Google Kubernetes Engine

Am trying to run Elastic APM in GKE cluster.我正在尝试在 GKE 集群中运行 Elastic APM。 I have installed elastic-search , kibana and apm-server .我已经安装了elastic-searchkibanaapm-server All services are up and running.所有服务都已启动并正在运行。 All these components has been through helm charts.所有这些组件都通过了 helm 图表。 Below are the configuration for each component.下面是每个组件的配置。

apmConfig:
  apm-server.yml: |
    apm-server:
      host: "0.0.0.0:8200"

    queue: {}

    output.elasticsearch:
      hosts: ["http://elasticsearch-master.monitoring.svc.cluster.local:9200"]
      username: "elastic"
      password: "password"
kibanaConfig: 
  kibana.yml: |
    server.host: 0.0.0.0
    server.port: 5601
    elasticsearch.hosts: "http://elasticsearch-master.monitoring.svc.cluster.local:9200"
    kibana.index: ".kibana"
    server.basePath: "/kibana"
    server.rewriteBasePath: true
    server.publicBaseUrl: "https://mydomain/kibana"
    elasticsearch:
      username: "kibana_system"
      password: "password"

I have tried to add APM integration to one of my service by using the below config:我尝试使用以下配置将 APM 集成添加到我的一项服务中:

var apm = require('elastic-apm-node').start({

    // Override the service name from package.json
    // Allowed characters: a-z, A-Z, 0-9, -, _, and space
    serviceName: 'shopping',
    
    // Use if APM Server requires a secret token
    secretToken: '',
    
    // Set the custom APM Server URL (default: http://localhost:8200)
    serverUrl: 'https://mydomain/apm',
    
    // Set the service environment
    environment: 'production'
    })

When I start the service, I get the below error in logs:当我启动服务时,我在日志中收到以下错误:

{"log.level":"error","@timestamp":"2022-08-18T10:08:31.584Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"APM Server transport error (301): Unexpected APM Server response"}

301 - Moved permanently. 301 - 永久移动。 It would be great, if I could get any help?如果我能得到任何帮助,那就太好了?

The problem have been solved.问题已解决。 The reason was because I was using a proxy and hitting port 80, while in the APM server service I was using port as 8200.原因是我使用了代理并访问了 80 端口,而在 APM 服务器服务中我使用的是 8200 端口。

After changing the port to 80 and targetPort to 8200 value in apm server service, I was able to correctly instrument Elastic APM with my services.在 apm 服务器服务中将端口更改为 80 并将 targetPort 值更改为 8200 后,我能够使用我的服务正确地检测 Elastic APM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌 Kube.netes 引擎到云端 SQL - Google Kubernetes Engine to Cloud SQL terraform google kube.netes 引擎中的权限 compute.regions.get 错误 - Permission compute.regions.get error in terraform google kubernetes engine http -> https 在 Google Kubernetes 引擎中重定向 - http -> https redirect in Google Kubernetes Engine 什么是 Google Kubernetes Engine 版本 1.13.12? - What is Google Kubernetes Engine version 1.13.12? Kubernetes HTTPS Google 容器引擎中的入口 - Kubernetes HTTPS Ingress in Google Container Engine 为什么默认的 Google Kubernetes Engine 集群中有 3 个节点? - Why are there 3 nodes in a default Google Kubernetes Engine cluster? 如何将数据从 Google Cloud VM 迁移到 Google Kube.netes Engine? - How to migrate data from Google Cloud VM to Google Kubernetes Engine? 使用 elastic-apm jar java 代理与 aws elastic beanstalk - use elastic-apm jar java agent with aws elastic beanstalk GCP GKE Google Kube.netes Engine 与服务器 localhost:8080 的连接被拒绝 - GCP GKE Google Kubernetes Engine The connection to the server localhost:8080 was refused 更新 Google Kube.netes 引擎 Web 应用程序的 Web 前端 - Update the Web-Front-End of a Google Kubernetes Engine Webapplication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM