4.04L Create a bargauge panel - MartinWong06/grafana GitHub Wiki
-
Click on the "Add" button in the Grafana dashboard, then select "Visualization" from the dropdown menu.
-
Select the "Bargauge" visualization type.
-
In the "Query" tab, choose the data source that contains the data you want to use for the bargauge chart.
-
Select the query that provides the data you want to display in the bargauge chart.
sum(rate(prometheus_http_requests_total{code="200"}[5m])) by (job)
This query calculates the rate of Prometheus HTTP requests over the past 5 minutes with a status code of 200, grouped by the job label. It can be used to create a bargauge chart that shows the number of requests per job, with the height of the bars representing the total number of requests and the length of the bars representing the percentage of the total requests for each job.
-
In the "Options" tab, configure the following settings:
- "Minimum" and "Maximum" values: the minimum and maximum values for the bargauge chart.
- "Thresholds": set the color for different ranges of values.
- "Value mappings": define custom mappings between the values and the labels displayed in the bargauge chart.
-
Save the panel and view the bargauge chart.