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
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.
Provided tutorial was updated 2 years ago.
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.
In requirements you have statement:
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.
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.
Any Prometheus queries that match
pod_name
andcontainer_name
labels (e.g. cadvisor or kubelet probe metrics) must be updated to use pod and container instead.
Please check this Github Thread about dashboard bug for more information.
Solution
Please change pod_name
to pod
in your query.
Kubernetes version v1.16.0 has Removed cadvisor metric labels pod_name
and container_name
to match instrumentation guidelines. 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.
You can check: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.16.md#metrics-changes