Grafana仪表板不显示pod名称,而是显示pod_name [英] Grafana dashboard not displaying pod name instead pod_name

查看:599
本文介绍了Grafana仪表板不显示pod名称,而是显示pod_name的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在kubernetes集群上部署了应用程序,并使用prometheus和grafana进行了监视.对于使用Grafana仪表板进行的kubernetes吊舱监控: Kubernetes集群监控(通过Prometheus) https://grafana. com/grafana/dashboards/315

I have deployed application on kubernetes cluster and for monitoring using prometheus and grafana. For kubernetes pods monitoring using Grafana dashboard: Kubernetes cluster monitoring (via Prometheus) https://grafana.com/grafana/dashboards/315

我已经使用ID 315导入了仪表板,并且该仪表板的反射没有pod名称和容器名称,而是获得pod_name.任何人都可以帮助我如何在仪表板上获取吊舱名称和容器名称.

I had imported the dashboard using id 315 and its reflecting without pod name and containers name instead getting pod_name . Can anyone pls help how can i get pod name and container name in dashboard.

推荐答案

提供的教程已于2年前进行了更新.

Provided tutorial was updated 2 years ago.

Kubernetes的当前版本为 1.17 .根据标签,教程已在目前很旧的Prometheus v. 1.3.0Kubernetes v.1.4.0Grafana v.3.1.1上进行了测试.

Current version of Kubernetes is 1.17. As per tags, tutorial was tested on Prometheus v. 1.3.0, Kubernetes v.1.4.0 and Grafana v.3.1.1 which are quite old at the moment.

在要求中您需要声明:

Prometheus将使用 cAdvisor通过kubelet 服务(默认情况下在Kubernetes集群的每个节点上运行)和仅通过kube-apiserver服务提供的指标.

Prometheus will use metrics provided by cAdvisor via kubelet service (runs on each node of Kubernetes cluster by default) and via kube-apiserver service only.

Kubernetes 1.16指标中,如pod_namecontainer_name的标签已被删除.取而代之的是,您需要使用podcontainer.您可以在此处进行验证.

In Kubernetes 1.16 metrics labels like pod_name and container_name was removed. Instead of that you need to use pod and container. You can verify it here.

任何与pod_namecontainer_name标签匹配的Prometheus查询(例如cadvisor或kubelet探测指标)必须更新为使用pod和容器.

Any Prometheus queries that match pod_name and container_name labels (e.g. cadvisor or kubelet probe metrics) must be updated to use pod and container instead.

请查看有关仪表板错误的此Github主题.

Please check this Github Thread about dashboard bug for more information.

解决方案

请在查询中将pod_name更改为pod.

这篇关于Grafana仪表板不显示pod名称,而是显示pod_name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆