Grafana dashboard: hwmon

Make sure the Prometheus data source in grafana has `Scrape interval` set to the double of greatest scrape interval! This will no longer be necessary once https://github.com/grafana/grafana/issues/21417 is released.

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.1.5"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 12950,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1599325359506,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 7,
      "panels": [],
      "repeat": "instance",
      "title": "$instance",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 4,
      "interval": "",
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideEmpty": true,
        "hideZero": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "maxPerRow": 2,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "repeatDirection": "h",
      "seriesOverrides": [
        {
          "$$hashKey": "object:207",
          "alias": "/Critical*./",
          "color": "#E24D42",
          "dashes": true,
          "fill": 0,
          "linewidth": 2
        },
        {
          "$$hashKey": "object:208",
          "alias": "/Max*./",
          "color": "#EF843C",
          "dashes": true,
          "fill": 0,
          "linewidth": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "# The nicest possible display of a metric...\r\nnode_hwmon_temp_celsius{instance=~\"$instance\"} \n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n# ...but it may filter out metrics that do not have a label, so as a fallback use the machine sensor name\r\n  or on(instance,chip,sensor) label_replace(node_hwmon_temp_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n  or on(instance,chip,sensor) label_replace(label_replace(node_hwmon_temp_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\"), \"chip_name\", \"$0\", \"chip\", \".*\")",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{chip_name}}/{{label}}",
          "refId": "A",
          "step": 240
        },
        {
          "expr": "node_hwmon_temp_crit_alarm_celsius{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n  or label_replace(node_hwmon_temp_crit_alarm_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n    unless on(instance,chip,sensor) node_hwmon_sensor_label",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Critical Alarm {{ chip_name }}/{{ label }}",
          "refId": "B",
          "step": 240
        },
        {
          "expr": "node_hwmon_temp_crit_celsius{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n  or label_replace(node_hwmon_temp_crit_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n    unless on(instance,chip,sensor) node_hwmon_sensor_label",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Critical  {{ chip_name }}/{{ label }}",
          "refId": "C",
          "step": 240
        },
        {
          "expr": "node_hwmon_temp_crit_hyst_celsius{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n  or label_replace(node_hwmon_temp_crit_hyst_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n    unless on(instance,chip,sensor) node_hwmon_sensor_label",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Critical Hysteresis  {{ chip_name }}/{{ label }}",
          "refId": "D",
          "step": 240
        },
        {
          "expr": "node_hwmon_temp_max_celsius{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n  or label_replace(node_hwmon_temp_max_celsius{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n    unless on(instance,chip,sensor) node_hwmon_sensor_label",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Max  {{ chip_name }}/{{ label }}",
          "refId": "E",
          "step": 240
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Temperature",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:729",
          "format": "celsius",
          "label": "Temperature",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:730",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 9,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideEmpty": true,
        "hideZero": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:1119",
          "alias": "/Max.*/",
          "color": "#E02F44",
          "dashes": true,
          "linewidth": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "# The nicest possible display of a metric...\nnode_hwmon_in_volts{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n# ...but it may filter out metrics that do not have a label, so as a fallback use the machine sensor name\n  or on(instance,chip,sensor) label_replace(node_hwmon_in_volts{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n  or on(instance,chip,sensor) label_replace(label_replace(node_hwmon_in_volts{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\"), \"chip_name\", \"$0\", \"chip\", \".*\")",
          "interval": "",
          "legendFormat": "{{ chip_name }}/{{label}}",
          "refId": "A"
        },
        {
          "expr": "",
          "interval": "",
          "legendFormat": "",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Voltage",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:821",
          "format": "volt",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:822",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 11,
      "interval": "",
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:1660",
          "alias": ""
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "# The nicest possible display of a metric...\r\nnode_hwmon_fan_rpm{instance=~\"$instance\"} \r\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n# ...but it may filter out metrics that do not have a label, so as a fallback use the machine sensor name\r\n  or on(instance,chip,sensor) label_replace(node_hwmon_fan_rpm{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n  or on(instance,chip,sensor) label_replace(label_replace(node_hwmon_fan_rpm{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\"), \"chip_name\", \"$0\", \"chip\", \".*\")",
          "instant": false,
          "interval": "",
          "legendFormat": "{{ chip_name }}/{{ label }}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Fan Speed",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1665",
          "format": "rotrpm",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:1666",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 22,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideEmpty": true,
        "hideZero": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:1119",
          "alias": "/Max.*/",
          "color": "#E02F44",
          "dashes": true,
          "linewidth": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "# The nicest possible display of a metric...\nnode_hwmon_curr_amps{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n# ...but it may filter out metrics that do not have a label, so as a fallback use the machine sensor name\n  or on(instance,chip,sensor) label_replace(node_hwmon_curr_amps{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n  or on(instance,chip,sensor) label_replace(label_replace(node_hwmon_curr_amps{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\"), \"chip_name\", \"$0\", \"chip\", \".*\")",
          "interval": "",
          "legendFormat": "{{ chip_name }}/{{label}}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Amperage",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:821",
          "format": "amp",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:822",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 23
      },
      "hiddenSeries": false,
      "id": 28,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideEmpty": true,
        "hideZero": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:1119",
          "alias": "/Max.*/",
          "color": "#E02F44",
          "dashes": true,
          "linewidth": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "# The nicest possible display of a metric...\nnode_hwmon_power_average_watt{instance=~\"$instance\"}\n  * on(instance,chip,sensor) group_left(label) node_hwmon_sensor_label \r\n  * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\n# ...but it may filter out metrics that do not have a label, so as a fallback use the machine sensor name\n  or on(instance,chip,sensor) label_replace(node_hwmon_power_average_watt{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\") \r\n    * on(instance,chip) group_left(chip_name) node_hwmon_chip_names\r\n  or on(instance,chip,sensor) label_replace(label_replace(node_hwmon_power_average_watt{instance=~\"$instance\"}, \"label\", \"$0\", \"sensor\", \".*\"), \"chip_name\", \"$0\", \"chip\", \".*\")",
          "interval": "",
          "legendFormat": "{{ chip_name }}/{{label}}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Power",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:821",
          "format": "watt",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:822",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "linux",
    "hwmon",
    "temperature",
    "fan speed",
    "voltage",
    "amperage",
    "power"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(node_uname_info, instance)",
        "hide": 0,
        "includeAll": true,
        "label": "Instance",
        "multi": true,
        "name": "instance",
        "options": [],
        "query": "label_values(node_uname_info, instance)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "hwmon",
  "uid": "JfD8nbvMk",
  "version": 5
}