4.03L Create gauge panel - MartinWong06/grafana GitHub Wiki
-
Click on the "Add" button in the Grafana dashboard, then select "Visualization" from the dropdown menu.
-
Select "Gauge" as the panel type.
-
In the Metrics tab, select the data source and enter the PromQL query for the metric you want to display. For example, to display the CPU usage as a percentage, you could use the query:
This query calculates the average CPU usage over the last 5 minutes and subtracts it from 100 to get the percentage of CPU usage.100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
-
In the Options tab, you can configure the appearance of the gauge chart, such as the minimum and maximum values, the color thresholds, and the gauge type.
-
Click on "Apply" to save the panel and view the gauge chart in the dashboard.
The resulting gauge chart will show the current value of the metric as a pointer on a circular gauge, with color zones indicating the different levels of the metric.