In a Grafana panel, how do thresholds, value mappings, units and field overrides relate to one another, and what is the relationship between a panel threshold and an alert?
answer
- defaults + overrides (matcher → properties), overrides win
- percentage thresholds need explicit min/max
- mappings: value / range / regex / special, first match wins
- colour scheme 'from thresholds' is what makes colours appear
- threshold = paint, alert rule = separate server-side object
basics
~20 sField defaults (unit, decimals, min/max, thresholds, mappings) apply to every field; overrides re-apply properties to fields matched by name, regex, type or query, and win over defaults. Thresholds and mappings are display-only — they colour and rename values, they never trigger anything.
solid answer
~50 sPanels carry a **field configuration**: defaults applied to every field (unit, decimals, min/max, no-value text, colour scheme, thresholds, value mappings) plus **overrides**, which are matcher-plus-property rules — match by field name, by regex, by field type, or by the query that produced it — and take precedence over the defaults. **Thresholds** are a base step plus ordered steps with colours, either absolute or percentage (percentage is relative to the field's Min/Max, so it is meaningless without them). They drive colour when the colour scheme is *From thresholds*, and they can be drawn as lines or shaded areas on a time series. **Value mappings** replace a raw value with display text and optionally a colour: exact value, range, regex, or a special case (null, NaN, empty). The first matching rule wins, so ordering matters. All of this is presentation. A red panel notifies nobody: alert rules are separate objects evaluated on the server against their own queries and conditions, on their own schedule.
go deeper
Know that units, thresholds and value mappings are display settings, that overrides target specific fields, and that a red panel is not an alert.
Explain the defaults-plus-overrides precedence, absolute versus percentage thresholds, and first-match-wins mapping order with concrete examples.
Talk about drift between visual thresholds and alert conditions, data-driven thresholds via Config from query results, and unit mistakes that make dashboards confidently wrong.
Treat thresholds and units as a shared vocabulary across the dashboard estate — consistent colour meaning, one definition of 'bad' shared with the alerting layer — rather than per-panel decoration.
## Two layers: defaults and overrides Every Grafana panel has a field configuration that is applied *after* transformations and *before* rendering. It has two layers. **Defaults** apply to every field in every frame the panel received: unit, decimal places, display name template, Min/Max, "No value" text, colour scheme, thresholds, value mappings, links, and panel-specific properties such as line width or fill opacity. **Overrides** are exceptions. Each override is a *matcher* plus a list of *properties*. Matchers include: fields with a specific name, fields matching a regular expression, fields of a given type, and fields returned by a specific query (query A vs query B). Properties are the same catalogue as the defaults. Overrides win over defaults, and later overrides win over earlier ones for the same property. This is how you put one series on a right-hand axis in percent while the rest stay on the left in bytes, without touching the query. The practical consequence: if a display setting looks stuck, check the override list before the defaults — a regex override you forgot is the usual culprit. ## Units, decimals and Min/Max Units are more than cosmetic. Grafana formats values by unit family (bytes, bytes/sec, seconds, percent (0–100) vs percent unit (0–1), currency), and picking the wrong one produces confidently wrong dashboards — the classic being *percent* against a ratio that is actually 0–1, giving a value of 0.97% instead of 97%. Decimals default to automatic. Min/Max bound the axis or gauge scale and, crucially, define what "percentage thresholds" mean. ## Thresholds A threshold configuration is a **base** colour plus ordered **steps**, each a value and a colour. A value takes the colour of the highest step it reaches or exceeds. Two modes exist: - **Absolute**: the step value is in the field's own units (latency > 0.5 s). - **Percentage**: the step is a percentage of the range between Min and Max. Without explicit Min/Max, that range is derived from the data and moves as the data moves, so percentage thresholds silently rescale. Set Min/Max whenever you use percentage mode. Where thresholds actually show up depends on the panel and the colour scheme. Set the colour scheme to *From thresholds* and stat/gauge/bar-gauge/table cells colour themselves. In a time series panel, thresholds can additionally be drawn as horizontal lines or shaded regions — a visual reference line, nothing more. Thresholds can also be made data-driven with the *Config from query results* transformation, which reads a per-row limit from a query and applies it as that field's threshold — useful when the limit is a property of the entity (per-service SLO) rather than a constant. ## Value mappings Value mappings translate raw values into human display text and optional colour. Four kinds: - **Value**: exact match (`0` → `DOWN` red, `1` → `UP` green). The standard fix for boolean-ish gauges. - **Range**: from/to, inclusive, for banding continuous values. - **Regex**: pattern on string values, with capture-group substitution for rewriting long identifiers. - **Special**: `null`, `NaN`, `null + NaN`, empty string, `true`/`false` — how you turn a gap into the word "No data" instead of a blank tile. Mappings are evaluated in order and the first match wins, so put the specific rules above the broad ones. Like everything else in field config, a mapping changes only what is drawn: the underlying numbers in the panel inspector are untouched, and a mapped label does not travel anywhere else. ## The threshold-versus-alert boundary This is the question inside the question. A panel threshold is display state, evaluated in the browser of whoever is looking at the dashboard. If nobody has the dashboard open, nothing happens. Alerting is a separate subsystem: rules are their own objects with their own queries, their own evaluation interval, their own pending/firing state machine and their own notification routing, evaluated by the Grafana server independent of any browser session. Never answer "I set a threshold on the panel" to "how would you get paged". The corollary matters operationally: because the two are separate, they drift. A panel coloured red at 500 ms while the rule fires at 800 ms will make every responder distrust the dashboard. Keeping the visual threshold and the alert condition numerically aligned — and reviewing them together when either changes — is the discipline that keeps a dashboard usable during an incident.
- A stat panel shows 0.97 with a percent unit and everyone reads it as an outage. What is wrong?The field carries a ratio in the range 0–1 but the unit chosen is 'percent (0–100)', so Grafana formats 0.97 as 0.97%. Either select the 'percent (0.0–1.0)' unit, which multiplies for display, or multiply in the query. It is a display-unit mismatch, not a data problem — and it is worth checking the thresholds too, because they will have been set in the wrong scale as well.
- How would you show a different threshold per service in a single table panel?Use the Config from query results transformation: one query returns the per-service limit, and the transformation maps that field onto the value field's threshold configuration, so each row is coloured against its own limit. The alternative — a regex override per service — does not scale and goes stale as services come and go.
saying these in an interview costs you the question
- Saying a panel threshold will notify someone or page the on-call
- Using percentage thresholds without setting Min and Max
- Expecting colours to appear while the colour scheme is still a classic palette rather than From thresholds
- Believing a value mapping changes the underlying data rather than the display
- Forgetting that an override beats the defaults, then hunting the wrong setting