Course outline

Grafana / Basic: sources, fields, and interpretation / Lesson 5

Visualizations, units, and reducers

Choose a panel for a specific question and review field units, selection, reduction, and missing-value behavior before trusting a displayed number.

About 4 min readContent reviewed
On this page

Lesson goals

  • Compare time-series, table, and stat questions.
  • Separate display units from numeric conversion.
  • Explain last, last available, and mean reductions.

Choose the visualization from the decision

A time-series panel shows change over time, a table preserves rows and dimensions, and a stat emphasizes a selected or reduced value. A bar gauge or state view can support other comparisons, but no visualization repairs an incorrect source contract. For transit operations, current delay, worst delay during an incident, and fraction of on-time departures are different questions. Name the intended population and time meaning in the panel title and description. Avoid selecting a visually dramatic panel first and then forcing available data into it without checking which information disappears.

A display setting describes the value it receives

Standard field options configure presentation such as units and decimals. They do not generally change the underlying returned value or repair a source that mixed seconds and milliseconds. The JSON fragment sets a seconds display unit in a classic field configuration, with one displayed decimal. It is not an imported or rendered panel. The same default can affect several fields, including a count field that should not carry a duration unit. Use appropriate field selection and overrides rather than applying one label to unrelated quantities. Document any actual numeric conversion separately.

json Illustrative seconds-display field configuration
{"fieldConfig":{"defaults":{"unit":"s","decimals":1},"overrides":[]}}

The fragment configures presentation only and is incomplete as a panel. It neither converts a millisecond source nor verifies Grafana formatting behavior.

Reduction is a measurement decision

A stat may show the final value, the final available value, a mean, a maximum, or another supported calculation. Those choices can disagree legitimately. The offline fixtureโ€™s final position is missing, its last available value is eight, and its observed-value mean is five. Picking last available can keep an old value visible after collection stopped; picking maximum answers a peak question rather than current status. Keep the reducer, sample count, and freshness visible when decisions depend on them. A calculation over already averaged intervals can also need weighting that a simple panel mean does not supply.

python Offline reducer comparison
values = [2.0, 8.0, None]
observed = [value for value in values if value is not None]
print("last_position", values[-1])
print("last_available", observed[-1])
print("observed_mean", sum(observed) / len(observed))
Expected output
last_position None
last_available 8.0
observed_mean 5.0

These fixed-list calculations are not Grafana reducer execution. They demonstrate distinct questions and do not justify ignoring missing data in every case.

Preserve scale and missing evidence

Axis bounds, logarithmic scale, decimal precision, null connections, and value mappings influence what a reader notices. Truncating a scale can exaggerate a small change, while an automatic wide scale can hide a relevant one. These settings need a documented purpose rather than universal prohibitions. Do not map missing data to an on-time label without evidence. A color or display rounding is not a backend threshold evaluation. Include units and meaningful labels for separate axes or fields, and review accessibility so essential status is not communicated only through color.

Review query output and rendering together

Use a known-value fixture containing normal, extreme, zero, missing, and stale observations. Explain which field and calculation the panel should display before checking its appearance. A screenshot can confirm layout but not query authorization, source completeness, or semantic correctness. This lesson executes only local list calculations and supplies an unexecuted field fragment. No Grafana renderer, unit formatter, plugin reducer, data-source query, or dashboard import is tested. Keep those boundaries in the handoff and verify the actual selected version and panel when an authorized isolated integration becomes available.

Common errors and fixes

Changing the unit label is called a data conversion

Why it happens
Formatting was confused with underlying numeric meaning.
How to fix it
Convert at a reviewed measurement layer when needed.
Prevent it next time
Test a known duration and display contract.

An old last-available value is presented as current

Why it happens
Reducer choice concealed missing updates.
How to fix it
Expose source age and choose a truthful reduction.
Prevent it next time
Test stopped-source cases.

A panel mean is treated as an event-weighted service mean

Why it happens
Input intervals or populations have unequal weight.
How to fix it
Review the underlying aggregation contract.
Prevent it next time
Use an uneven-traffic fixture.

Check your understanding

1. The last delay is null but the previous value is eight seconds. Should the panel automatically show eight as current?

Show worked solution

Not without a clear freshness and reduction policy. Last available answers a different question from the latest position, and may retain stale evidence. Show the point age or unknown state when current status matters. Decide from the source contract rather than choosing the most reassuring display.

2. Why can a table be useful before choosing a final visualization?

Show worked solution

It can expose field types, dimensions, individual values, and missing positions that a stat or chart reduction hides. It does not establish correctness by itself, but it helps verify whether the source response and transformation match the intended population before visual emphasis removes detail.

Key takeaways

  • Visualization choice follows the question.
  • Units and reducers are explicit interpretation contracts.
  • A polished display cannot establish untested source or plugin behavior.

Official references