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

Prometheus无法采集kong-ingress-controller metrics问题求助

问题排查及修复方案
  • ServiceMonitor端口配置错误
    你当前配置的ServiceMonitor使用kong-proxy作为采集端口,该端口是Kong处理业务代理请求的端口,默认监听80/443,并非metrics指标端口。Kong的指标默认暴露在8100端口,对应Kong Service的端口名为metrics,需要将ServiceMonitor的endpoints.port修改为metrics,同时可以显式指定metrics路径避免异常:
spec:
  endpoints:
  - interval: 30s
    port: metrics
    path: /metrics
    scrapeTimeout: 10s
  • Kong Helm安装未开启Metrics端口暴露
    你当前的kong.yaml配置仅添加了Pod注解,没有开启Kong Service的metrics端口暴露,Prometheus无法通过Service找到采集入口。需要在kong.yaml中补充metrics配置:
# 新增到kong.yaml中
metrics:
  enabled: true
  serviceMonitor:
    enabled: false # 已自定义ServiceMonitor无需chart自动创建
podAnnotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8100"

修改后执行helm upgrade kong kong/kong -n kong -f kong.yaml更新配置即可。

  • 检查Prometheus跨命名空间访问权限
    kube-prometheus-stack默认创建的Prometheus ServiceAccount权限可能仅覆盖monitoring命名空间,需要确认ClusterRoleprometheus-kube-prometheus-prometheus是否包含kong命名空间下的services、endpoints、pods的get/list/watch权限,如果缺少需要补充对应权限规则。
  • 确认Kong Prometheus全局插件状态
    执行kubectl get kongclusterplugins确认prometheus插件状态正常,无配置报错。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.28 21:54:06