如何配置Istio Helm图表以使用外部Kube-prometheus-stack?

发布于 2025-02-10 01:56:35 字数 621 浏览 3 评论 0原文

我使用 base & istiod 使用此 documents istio-system 名称空间。

我部署了Prometheus,Grafana&使用 kube-prometheus-stack Helm Chart。

此工作负载的每个豆荚都可以正常工作;我没有看到任何错误。不知何故,我没有在Prometheus UI中获得与ISTIO工作量相关的指标。因此,我在Kiali仪表板上没有看到任何网络图。

谁能帮我解决这个问题?

I have deployed the istio service mesh on the GKE cluster using base & istiod helm charts using this documents in the istio-system namespace.

I have deployed Prometheus, grafana & alert-manager using kube-prometheus-stack helm chart.

Every pod of this workload is working fine; I didn't see any error. Somehow I didn't get any metrics in Prometheus UI related to istio workload. Because of that, I didn't see any network graph in kiali dashboard.

Can anyone help me resolve this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

童话 2025-02-17 01:56:35

我能够通过为数据平面和控制平面创建服务监视器来解决上述问题。
请点击下面的链接以获取更多详细信息。

https://tetrate.io/blog/how-to-configure-prometheus-operator-scrape-metrics-from-istio-1-6/

I was able to resolve the above mentioned issue by creating service monitors for data plane and control plane.
Follow below link for more details.

https://tetrate.io/blog/how-to-configure-prometheus-operator-scrape-metrics-from-istio-1-6/
夏末染殇 2025-02-17 01:56:35

通过通过Kube-Prometheus-stack Helm图表部署Prometheus,您需要为ISTIO指标添加ServiceMonitor,因为K8S注释(Prometheus.io/scrape)不起作用。创建这些servicemonitor以启用刮擦iStio指标:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-oper-istio-controlplane
  labels:
    release: prometheus
spec:
  jobLabel: istio
  selector:
    matchExpressions:
      - {key: istio, operator: In, values: [mixer,pilot,galley,citadel,sidecar-injector]}
  namespaceSelector:
    any: true
  endpoints:
  - port: http-monitoring
    interval: 15s
  - port: http-policy-monitoring
    interval: 15s
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-oper-istio-dataplane
  labels:
    monitoring: istio-dataplane
    release: prometheus
spec:
  selector:
    matchExpressions:
      - {key: istio-prometheus-ignore, operator: DoesNotExist}
  namespaceSelector:
    any: true
  jobLabel: envoy-stats
  endpoints:
  - path: /stats/prometheus
    targetPort: http-envoy-prom
    interval: 15s
    relabelings:
    - sourceLabels: [__meta_kubernetes_pod_container_port_name]
      action: keep
      regex: '.*-envoy-prom'
    - action: labelmap
      regex: "__meta_kubernetes_pod_label_(.+)"
    - sourceLabels: [__meta_kubernetes_namespace]
      action: replace
      targetLabel: namespace
    - sourceLabels: [__meta_kubernetes_pod_name]
      action: replace
      targetLabel: pod_name

一旦创建了这些服务人,指标将在几分钟内开始出现。您可以检查Prometheus->状态 - 目标将有类似的条目:
servicemonitor/yournamespace/prometheus-oper-istio-controlplane/0(1/1 UP)
servicemonitor/yournamespace/prometheus-oper-istio-dataplane/0(1/1 up)

With prometheus deployed via kube-prometheus-stack helm charts, you will need to add servicemonitor for istio metrics since k8s annotations (prometheus.io/scrape) doesn't work. Create these servicemonitor to enable scraping istio metrics:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-oper-istio-controlplane
  labels:
    release: prometheus
spec:
  jobLabel: istio
  selector:
    matchExpressions:
      - {key: istio, operator: In, values: [mixer,pilot,galley,citadel,sidecar-injector]}
  namespaceSelector:
    any: true
  endpoints:
  - port: http-monitoring
    interval: 15s
  - port: http-policy-monitoring
    interval: 15s
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: prometheus-oper-istio-dataplane
  labels:
    monitoring: istio-dataplane
    release: prometheus
spec:
  selector:
    matchExpressions:
      - {key: istio-prometheus-ignore, operator: DoesNotExist}
  namespaceSelector:
    any: true
  jobLabel: envoy-stats
  endpoints:
  - path: /stats/prometheus
    targetPort: http-envoy-prom
    interval: 15s
    relabelings:
    - sourceLabels: [__meta_kubernetes_pod_container_port_name]
      action: keep
      regex: '.*-envoy-prom'
    - action: labelmap
      regex: "__meta_kubernetes_pod_label_(.+)"
    - sourceLabels: [__meta_kubernetes_namespace]
      action: replace
      targetLabel: namespace
    - sourceLabels: [__meta_kubernetes_pod_name]
      action: replace
      targetLabel: pod_name

Once these servicemonitors are created, metrics would start appearing in a few minutes. You can check the status under your Prometheus -> Status - Targets There will be entry something like this:
serviceMonitor/yournamespace/prometheus-oper-istio-controlplane/0 (1/1 up) and
serviceMonitor/yournamespace/prometheus-oper-istio-dataplane/0 (1/1 up)

↘人皮目录ツ 2025-02-17 01:56:35

ISTIO希望Prometheus通过使用Kubernetes注释Prometheus.io/scrapePrometheus.io/port,以及Prometheus.io Prometheus.io, /路径

普罗米修斯社区已决定,虽然流行的注释虽然不足以实现默认情况下的实用性。因此,Kube-Prometheus-stack Helm图表并未使用这些注释发现POD。

为了使您的Prometheus安装以刮擦您的ISTIO指标,您需要以一种配置ISTIO来以您期望的Prometheus的安装方式公开指标(您必须检查Prometheus配置,我不知道它会通过默认值)或添加Prometheus scrape作业,该作业将使用上述注释进行发现。

有关如何将Prometheus与Istio整合的详细信息可用于在这里配置文件可用在这里

Istio expects Prometheus to discover which pods are exposing metrics through the use of the Kubernetes annotations prometheus.io/scrape, prometheus.io/port, and prometheus.io/path.

The Prometheus community has decided that those annotations, while popular, are insufficiently useful to be enabled by default. Because of this the kube-prometheus-stack helm chart does not discover pods using those annotations.

To get your installation of Prometheus to scrape your Istio metrics you need to either configure Istio to expose metrics in a way that your installation of Prometheus expects (you'll have to check the Prometheus configuration for that, I do not know what it does by default) or add a Prometheus scrape job which will do discovery using the above annotations.

Details about how to integrate Prometheus with Istio are available here and an example Prometheus configuration file is available here.

风追烟花雨 2025-02-17 01:56:35

需要在kube-prometheus-stack-stack helm Chart value.yaml中添加iStio的添加添加的crapconfigs。

prometheus:
  prometheusSpec:
    additionalScrapeConfigs:
      - {{ add your scrap config for istio }} 

Need to add additionalScrapConfigs for istio in kube-prometheus-stack helm chart values.yaml.

prometheus:
  prometheusSpec:
    additionalScrapeConfigs:
      - {{ add your scrap config for istio }} 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文