You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GKE网关后为OpenTelemetry Collector添加健康检查端点?

OpenTelemetry Collector健康检查端点无响应的解决方法

你遇到的问题主要来自两个配置疏漏:

  1. 端点绑定地址限制:你把健康检查端点设为localhost:13133,这会导致Collector只监听Pod内部的回环地址,外部(包括通过Pod IP访问)无法连接到这个端口。
  2. 扩展未显式启用:即使配置了health_check扩展,也需要在service.extensions数组里声明启用它,否则Collector不会加载该扩展。

修正后的完整配置示例

extensions:
  health_check:
    endpoint: "0.0.0.0:13133"  # 改为绑定所有网卡,允许外部访问
    path: "/health"
    check_collector_pipeline:
      enabled: true
      interval: "5m"
      exporter_failure_threshold: 5

service:
  extensions: ["health_check"]  # 必须显式启用该扩展
  # 以下是你的原有pipeline配置,按需保留
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [your_exporter]

额外验证步骤

  • 进入Pod内部执行curl http://localhost:13133/health,应返回状态码200和ok响应
  • 从集群内其他Pod访问http://<POD_IP>:13133/health,确认能正常获取响应
  • 确保你使用的是otelcol-contrib镜像(健康检查扩展属于contrib组件,核心镜像otelcol不包含它)

GKE网关配置适配

修改完Collector配置后,在GKE网关的健康检查规则中,将目标端口设置为13133,检查路径设为/health即可满足网关的健康检查要求。

内容的提问来源于stack exchange,提问作者Feiga Lubow

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 04:56:06