kubernetes-app icon indicating copy to clipboard operation
kubernetes-app copied to clipboard

Cluster Disk Usage is broken since there is no nodename label

Open oryagel opened this issue 7 years ago • 10 comments

In K8s Cluster dashboard the disk usage panel uses node_filesystem_size{nodename=~"$node"}. In my Prometheus instance (and I guess that in other as well), this metric doesn't have a nodename label. What am I missing here?

oryagel avatar Jun 25 '18 12:06 oryagel

Same issue

ghost avatar Jul 28 '18 09:07 ghost

same issue

vpistis avatar Jul 30 '18 10:07 vpistis

same issue

duanyifei1937 avatar Jul 30 '18 12:07 duanyifei1937

Same here.

Any suggested workarounds?

WesleyCharlesBlake avatar Aug 02 '18 07:08 WesleyCharlesBlake

For Cluster Disk Usage gauge I changed the query to:

sum (container_fs_usage_bytes{device=~"^/dev/[nsx][v][bdm][a-z].+$",id="/",instance=~"^$node"}) / sum (container_fs_limit_bytes{device=~"^/dev/[nsx][v][bdm][a-z].+$",id="/",instance=~"^$node"})

and for me seems ok.

I changed also the queries for the Cluster Disk Capacity: usage:

sum (container_fs_usage_bytes{device=~"^/dev/[xv][sv]d[a-z][1-9]$",id="/",instance=~"$node"})

limit:

sum (container_fs_limit_bytes{device=~"^/dev/[xv][sv]d[a-z][1-9]$",id="/",instance=~"$node"})

*I use kubernetes 1.9.6

vpistis avatar Aug 02 '18 07:08 vpistis

I tried a bunch of different queries and got results, but this seems more accurate. Thanks @vpistis . I will play around with the queries some more and let you know how I go. Cheers

WesleyCharlesBlake avatar Aug 02 '18 08:08 WesleyCharlesBlake

I'm using this config for Prometheus, which contains nodename fix. The only difference from default config is that

          - source_labels: [__meta_kubernetes_pod_node_name]
            action: replace
            target_label: nodename

added to kubernetes-service-endpoints. I'm using Prometheus nodeExporter v0.15.2..

You can find more details here https://scalablesystem.design/categories/ds101/

ghost avatar Aug 02 '18 09:08 ghost

awesome thanks @artyomboyko ,

Including this:

          - source_labels: [__meta_kubernetes_pod_node_name]
            action: replace
            target_label: nodename

To the prometheus kubernetes-service-endpoints config works like a charm as well. Thanks for this!

WesleyCharlesBlake avatar Aug 02 '18 10:08 WesleyCharlesBlake

I had the same problem (no disk usage info in Grafana), but in my case it was version of NodeExporter. I was using 0.17, but in 0.16 they've changed node_filesystem_size -> node_filesystem_size_bytes. Rolled back to 0.15.2 and now it works.

goooseman avatar Jan 05 '19 09:01 goooseman

If you're using a newer version of node-exporter (version 0.16 or 0.17), you can use job rules defines on upgrade guide: https://github.com/prometheus/node_exporter/blob/master/docs/V0_16_UPGRADE_GUIDE.md#use-recording-rules This way older and newer metrics renamed both exists (but it take more space on prometheus).

seboudry avatar May 02 '19 09:05 seboudry