In Grafana, a single query returns several labelled series over time. Walk through how you would choose between the Time series, Stat, Gauge, Table and Heatmap panels, and explain what each one does to the query result before it renders.
answer
- panels render data frames, not queries
- stat/gauge = reduce calculation per series
- gauge needs explicit min/max
- table = one frame per query until joined
- heatmap = distribution, pre-bucketed or calculated
basics
~20 sTime series plots every point over time. Stat and Gauge reduce each series to one number (last, mean, max); Gauge adds a bounded min/max scale. Table shows the raw rows. Heatmap shows distribution. Choose by trend vs single value vs distribution.
solid answer
~50 sEvery Grafana panel renders **data frames** — typed columns, normally a time field plus labelled numeric fields — so the panel choice is a rendering decision, not a query decision. - **Time series**: needs a time field; draws one line/bar/point series per numeric field. Default for trends. - **Stat**: applies a *reduce calculation* (Last non-null by default, or mean/max/min) to each series and shows one big number per series — five series means five tiles unless you filter or reduce first. - **Gauge**: same reduction, but rendered against a bounded scale, so it is only meaningful when you set Min/Max and thresholds (percentages, SLO burn, disk used). - **Table**: renders frames as rows; multiple queries stay separate frames unless you join them with a transformation. - **Heatmap**: shows a distribution per time bucket, from pre-bucketed histogram data or by bucketing values itself. Rule of thumb: trend → time series; current value → stat/gauge; raw detail → table; distribution/latency spread → heatmap.
go deeper
Name the five panels and what each is for, and know that Stat and Gauge collapse a series to one number using a calculation such as Last non-null.
Add the data-frame framing: panels render typed frames, so wrong output usually means wrong data shape, fixed in the query or with a transformation.
Talk about honesty of the visualisation — sparkline behind a stat, heatmap instead of an averaged latency line, explicit gauge bounds — and about series-count effects on the browser.
Frame panel choice as a communication contract for the dashboard's audience: what decision does each panel support, and which panels are noise that will be ignored during an incident.
## What a panel actually receives A Grafana data source never returns "a graph". It returns one or more **data frames**: a table with typed columns (fields), each field carrying a name, a type (time, number, string, boolean), labels, and display configuration. A typical metrics response is a frame with a `time` field and one numeric field per series, where the series identity lives in the field's labels (`{instance="a", job="api"}`). A panel is a *renderer over frames*. Switching panel type never changes what was queried or how much data was fetched — it changes how the same frames become pixels. That single fact answers most of the follow-ups an interviewer asks here. ## Time series The general-purpose panel. It requires a time field; each numeric field becomes a series drawn as lines, bars or points. Per-series appearance (fill, width, axis placement, stacking, connect-nulls, soft min/max) is field configuration, and per-series exceptions are field overrides. If your frame has no time field, the panel refuses to render and asks you to convert the data (usually with a transformation). If your query returns thousands of series, the panel will still try to draw them — the legend and the browser are the bottleneck, not the query. ## Stat Stat reduces. Its **Calculation** option (Last *, Last non-null, Mean, Max, Min, Total, Count, Range, Delta…) collapses each series to a single value, and it renders one tile per series. The two things candidates miss: (1) "Last *" includes nulls while "Last non-null" skips them, which changes what a flapping metric shows; (2) if you did not expect N tiles, the fix is upstream — aggregate in the query, or use a Reduce/Filter transformation — not a panel option. Stat can also draw a sparkline behind the number (Graph mode: Area), which is the miniature trend that makes a single number honest. ## Gauge Gauge uses the same reduction as Stat but paints it on a bounded arc. It is only meaningful when the value has a real ceiling: percent used, quota consumed, error budget burned. Without an explicit Min/Max, Grafana derives the bounds from the data, and the gauge silently rescales as the data moves — a classic source of dashboards that always look half-full. Gauges pair with thresholds; unbounded quantities (request rate, byte counters) belong in a stat or a time series instead. ## Table Table renders frames literally: fields become columns, rows become rows. It is the right panel for inventory-shaped data, top-N lists, and last-value-per-label summaries. Important behaviours: multiple queries produce multiple frames and the table shows a frame selector rather than merging them — joining requires a *Join by field* or *Merge* transformation. Cells can be styled (coloured background from thresholds, gauge cells, sparkline cells, data links), and column display is controlled by field config plus an Organize fields transformation for renaming/hiding/reordering. ## Heatmap Heatmap answers "how were the values distributed", not "what was the value". It has two modes: consume data that is already bucketed (classic histogram series, one series per bucket boundary) or calculate buckets itself from raw values. The Y axis is the value bucket, the X axis is a time bucket, and cell colour encodes count. It is the standard latency-distribution panel and is far more honest than an averaged latency line, because it shows the tail rather than hiding it. ## How to choose out loud State the question the viewer is asking: - "Is it getting worse?" → Time series. - "Is it OK right now?" → Stat (with sparkline) or Gauge if bounded. - "Which ones are bad?" → Table sorted by the offending field. - "How is it spread?" → Heatmap (or histogram for a non-time distribution). ## Traps worth naming - Panel type does not reduce query cost; a Stat over a 30-day range still fetches 30 days. - Bar chart and Pie chart expect a categorical string field, not a time field; feeding them time-series frames produces nonsense. - Multiple series in Stat/Gauge is a data-shape problem, solved by the query or a transformation. - Legends, tooltips and value mappings are display concerns and never change the underlying numbers.
- Your Stat panel shows twelve tiles instead of one number. Why, and what are your options?Stat renders one tile per series, and the query returned twelve series. The options are, in order of preference: aggregate in the query so the backend returns one series; add a Reduce or Filter-by-value transformation to collapse or select series; or, if all twelve are genuinely interesting, switch to a Bar gauge or Table which are designed for many values. Changing panel options alone will not fix it.
- What happens if you point a Time series panel at a frame with no time field?It cannot render and shows a message that the data is missing a time field. Grafana requires a field typed as time to build the X axis — a string or numeric column that merely looks like a timestamp does not qualify. The fix is to make the data source type the column as time, or to convert it with a transformation such as Convert field type.
The query is the recording; the panel is the playback device. Choosing Stat over Time series is like reading the last frame of a video instead of watching it — the tape is identical, you just look at less of it.
saying these in an interview costs you the question
- Believing Stat or Gauge queries less data than Time series
- Using a Gauge without setting Min and Max, so the scale silently follows the data
- Expecting a Table panel to automatically merge the results of two queries
- Reaching for a heatmap when the question is 'what is the value now' rather than 'how is it distributed'
- Treating panel choice as a performance lever instead of a presentation choice