dotdc / grafana-dashboards-kubernetes

A set of modern Grafana dashboards for Kubernetes.
Apache License 2.0
2.51k stars 361 forks source link

[bug] Broken panels on k8s-views-nodes due to the nodename label #118

Closed vibhavachar closed 1 week ago

vibhavachar commented 1 month ago

Describe the bug

The dashbaords are really hepfull but ia m trying multi prometehus setup and i am unable to distinguish between different clusters. The jobs have the lablels, treid all relable configs but stil unable to get the node name metrics.

How to reproduce?

prometheus-community/kube-prometheus-stack --version 54.2.1

Expected behavior

able to see nodename info

Additional context

prometheus-node-exporter: namespaceOverride: "" podLabels:

Add the 'node-exporter' label to be used by serviceMonitor to match standard common usage in rules and grafana dashboards

##
jobLabel: ops-infra-tools-node-exporter

releaseLabel: true extraArgs:

NicoJDE commented 1 month ago

same problem here.

when i remove this filter it works. Screenshot 2024-08-16 at 11 36 15

logan-bobo commented 1 week ago

@NicoJDE we have recently also ran into a similar problem. However ours was due to how Flatcar set the hostname for nodes. Resulting in the nodename label being the hostname with no domain information and $node is an FQDN

For me the fix was to change the variable definition to instance, this for us was the nodes FQDN. Then as the value in $node is the FQDN we can simply filter on $node showing the metrics for the currently selected node.

"label_values(node_uname_info{instance=~\"$node\"},instance)",

This is now working in our K8s setup across AWS, GCP and Azure using kube-prometheus. I will port this fix back upstream now.

dotdc commented 1 week ago

There's a nodename label known issue, did you checked it? Don't hesitate to make a PR if you find another isssue or limitation.

logan-bobo commented 1 week ago

Thanks I will take a look at this one as it might be a better fix to our current issue rather than vendoring and altering the dashboards.

NicoJDE commented 1 week ago

@dotdc thanks for the hint, this works for me

dotdc commented 1 week ago

Great, closing the issue!