Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] - Missing cluster label in metrics from kubelet, kube-state-metrics... #3972

Open
bmgante opened this issue Nov 7, 2023 · 3 comments

Comments

@bmgante
Copy link

bmgante commented Nov 7, 2023

Hi everyone, using kube-prometheus-stack and noticed that default dashboards use a label cluster for the metrics generated by kube-state-metrics, kubelet, etc. However, the metrics generated do not have this label.

Example of one metric used in one rule which is then used in several dashboard pannels:

container_cpu_usage_seconds_total{container="alertmanager", cpu="total", endpoint="https-metrics", id="/kubepods.slice/kubepods-pod87e2ed11_9a16_445c_9d57_f79f27f0d284.slice/cri-containerd-b3444f5ab945fd924295a552249424ec551f7f3a23020de8bbf3596e2495c3c0.scope", image="quay.io/prometheus/alertmanager:v0.25.0", instance="x.x.x.x:10250", job="kubelet", metrics_path="/metrics/cadvisor", name="b3444f5ab945fd924295a552249424ec551f7f3a23020de8bbf3596e2495c3c0", namespace="monitoring", node="ip-10-30-131-229.ec2.internal", pod="alertmanager-kps-alertmanager-0", prometheus="monitoring/kps-prometheus", service="kps-kubelet"}

The rule which makes use of cluster label:

record:node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate
expr:sum by (cluster, namespace, pod, container) (irate(container_cpu_usage_seconds_total{image!="",job="kubelet",metrics_path="/metrics/cadvisor"}[5m])) * on (cluster, namespace, pod) group_left (node) topk by (cluster, namespace, pod) (1, max by (cluster, namespace, pod, node) (kube_pod_info{node!=""}))

Any idea on how to fix this? Should this cluster label be added manually through the following values.yaml parameter?

## Additional labels for PrometheusRule alerts
  additionalRuleLabels: {}

Thanks

@Fr0s1
Copy link

Fr0s1 commented Nov 12, 2023

I have the same problem, most of the dashboards show "No Data" when installing the latest Helm version 52.1.0 or downgrade to 51.9.4.

@knta7
Copy link

knta7 commented Nov 22, 2023

I have the same problem, most of the dashboards show "No Data" when installing the latest Helm version 52.1.0 or downgrade to 51.9.4.

if you are using k8s v1.24 or after and docker, docker plugin was removed from cAdvisor. See rancher/rancher#38934 (comment)

@deefdragon
Copy link

There is a PR open (#3863) But the issue appears to be upstream, and may need to be resolved elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants