首页 > 解决方案 > 使用 Prometheus 和 Envoy 侧车代理抓取应用程序指标

问题描述

我正在为我的工作负载使用 GKE。我已经在我的集群上安装了 Istio 1.11.0。我还istio-system使用此链接在命名空间中安装了 Prometheus 。

我在prom-test命名空间中部署了一个 Python 应用程序,它在端口 8080 收集指标,如下所示。

应用指标

我在部署文件中使用了以下注释来让Prometheus抓取指标

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8080"
    prometheus.io/scheme: http
    prometheus.io/path: "/metrics"

1)应用程序容器和2)特使代理容器中运行了2个容器

在此处输入图像描述

当我打开 Prometheus 仪表板时,我看到所有目标都已启动,并且对于我的应用程序,它正在被抓取

在此处输入图像描述

但我可以看到任何与应用程序相关的指标?

在此处输入图像描述

如果这里的退伍军人可以提供相同的建议,那将非常有帮助

标签: prometheusistiotelemetryistio-sidecaristio-prometheus

解决方案


我已经解决了这个问题。似乎为。Python 我需要将信息添加为prommetheus.yaml文件中的抓取配置。一旦我实现了相同的,它就开始工作了。

能够在 Istio prometheus 上查看指标。


推荐阅读