Grafana: Your First Panel
A panel is one question drawn on a dashboard. This lesson builds a time series panel that shows the shop request speed.
The panel query
Request speed for the whole shop, over five minutes.
sum(rate(http_requests_total{job="shopsentry"}[5m]))The Prometheus data source
One data source feeds every panel on the dashboard.
{"name": "Prometheus", "type": "prometheus", "url": "http://127.0.0.1:19103"}Read the panel back
The dashboard read back shows the panel with its query.
GET /api/dashboards/uid/shopsentry-legcExample
sum(rate(http_requests_total{job="shopsentry"}[5m]))Key points
- A panel shows the answer to one query.
- A time series panel draws values over time.
- Pick the Prometheus data source before you write the query.
- Set the unit to requests per second so the axis reads plainly.
- A panel needs a title that states its question.
- Save the dashboard so the panel stays put.
- Build the panel yourself instead of importing one.
In this example, the first panel asks Prometheus for the shop request speed and draws it as a line over time. Grafana returned 21 points across five minutes, ending at 1.1053 requests per second. The dashboard is the real ShopSentry dashboard on the live Grafana lab.
Note
This lab built the panel through the Grafana API and read it back the same way. The clicks below are the same steps in the UI.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Rust Playground
Exercise
Which panel type draws values over time?