grafana-dashboards icon indicating copy to clipboard operation
grafana-dashboards copied to clipboard

Show hwmon labels

Open daurnimator opened this issue 2 years ago • 2 comments

e.g. Currently for temperatures you use node_hwmon_temp_celsius{instance="$node",job="$job"} To get the label name, use: node_hwmon_temp_celsius{instance="$node",job="$job"} * ignoring(label) group_left(label) node_hwmon_sensor_label

Then please use {{ label }} as part of the legend.

daurnimator avatar Aug 17 '21 13:08 daurnimator

Additionally it looks like you can get better names for devices via node_hwmon_chip_names e.g. the chip label of my CPU is pci0000:00_0000:00:18_3; but if you join with node_hwmon_sensor_label you can get k10temp (which is the name of the kernel driver for AMD temperatures)

so perhaps e.g.:

node_hwmon_temp_celsius{instance="$node",job="$job"}
* on(instance,job,chip) group_left(chip_name) node_hwmon_chip_names
* on(instance,job,chip,sensor) group_left(label) node_hwmon_sensor_label

daurnimator avatar Aug 17 '21 14:08 daurnimator

I've made a few tweaks to how I use this dashboard, mainly making the node variable in the dashboard settings allow "mutli-value" and "all". image

I then used your queries but I had to drop the * on(instance,job,chip,sensor) group_left(label) node_hwmon_sensor_label from it since that was causing my k10temp CPU temperature readings to be dropped from the final set of returned metrics.

Because of my change of the node variable in the dashboard to multivalue/all I also had to update the = in the query (and most queries on the dashboard via a find/replace) with =~ instead. So for your helpful snippet @daurnimator combined with my changes to the dashboards' variable and compensating for the missing k10temp CPU temps I ended up with this as my final output in the Grafana dashboard:

node_hwmon_temp_celsius{instance=~"$node",job="$job"}
* on(instance,job,chip) group_left(chip_name) node_hwmon_chip_names

image image

goproslowyo avatar Sep 23 '23 21:09 goproslowyo