🎓 A1Learner
🔍
0 of 50 lessons completed

Grafana: Panel Types: When to Use Which

The question decides the panel. A trend needs a line, a single number needs a stat, and a share needs a table.

Stat: one current number

Total requests so far, as a single number.

sum(http_requests_total{job="shopsentry"})

Gauge: a value in a range

The shop is up, on a scale from 0 to 1.

shopsentry_up{job="shopsentry"}

Table: exact numbers side by side

Requests by route, as a table.

sum by (route) (http_requests_total{job="shopsentry"})

Heatmap: latency across buckets

Request times spread across the histogram buckets. The rates are flat right now because the shop traffic has stopped and only scrapes arrive.

sum by (le) (rate(http_request_duration_seconds_bucket{job="shopsentry"}[5m]))

Example

sum by (route) (http_requests_total{job="shopsentry"})

Key points

  • Use a time series panel to show how a value changes over time.
  • Use a stat panel to show one current number.
  • Use a gauge panel to show a value against a fixed range.
  • Use a bar panel to compare totals across groups.
  • Use a table panel to show exact numbers side by side.
  • Use a heatmap panel to show how values spread across buckets.
  • One query can feed several panel types, and each shows it differently.

In this example, the same query feeds a bar panel and a table panel. The bar shows which route is busiest at a glance, and the table gives the exact counts. The numbers are the real totals from the live ShopSentry lab.

Note

A panel type cannot fix a wrong query. Get the query right first.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

Which panel shows one current number?