Grafana Thresholds and Value Mappings

Numbers alone force readers to do mental work. A reading of 91 means nothing until someone remembers that 90 is the danger line. Thresholds and value mappings move that knowledge into the panel itself. Colours and friendly words tell the story, so anyone can read the screen in a second.

The Traffic Light Analogy

A traffic light never shows you the speed of the cars. It shows one clear signal: go, slow down, or stop. Thresholds turn raw numbers into the same kind of signal. Value mappings go one step further and replace cryptic codes with plain words, like swapping "0" for "Offline".

Value:   0 ---------- 70 ---------- 90 ---------- 100
Colour:  [  GREEN  ][   YELLOW   ][     RED      ]
Meaning:   healthy      watch it       act now

What a Threshold Does

A threshold defines a value where the colour changes. Every threshold list starts with a Base colour that covers everything below the first limit. Each extra step adds a new limit and a new colour.

StepStarts AtColour
BaseLowest valueGreen
Step 170Yellow
Step 290Red

A reading of 55 shows green, 75 shows yellow, and 95 shows red.

Where to Set Thresholds

Open the panel editor and search for Thresholds in the options pane. Click Add threshold, type the value, and pick a colour. Drag nothing and write no code. Grafana updates the preview immediately.

Absolute and Percentage Modes

Absolute mode compares the reading against fixed numbers, such as 90 degrees. Percentage mode compares the reading against the minimum and maximum of the panel. Use absolute for limits you know, like response time in milliseconds. Percentage mode fits panels whose scale changes.

Where the Colour Appears

Each panel type uses colour in its own way.

  • Stat panels colour the value or the whole background.
  • Gauge panels colour the arc.
  • Bar gauge panels colour each bar.
  • Time series panels draw dashed lines or shaded zones at each threshold when you enable threshold display.
  • Table panels colour cells once you set the cell type to colored text or colored background.

Thresholds on a Chart

Response Time (ms)
400 |                          RED ZONE
300 |- - - - - - - - - - - - - - - - - - -  300 ms
    |                  __
200 |      __        _/  \_   YELLOW ZONE
    |   __/  \__   _/      \
100 |__/        \_/         \__
    +------------------------------------
       10:00    10:20    10:40    11:00

The dashed line shows exactly where the team's promise ends. A line that crosses it signals trouble before anyone reads a single number.

What Value Mappings Do

Many systems report status as a code. A server might send 1 for online and 0 for offline. Another job reports 2 for failed. Readers should not have to memorise those codes. A value mapping tells Grafana to show a text label, and optionally a colour, in place of the raw value.

Mapping Types

TypeMatchesSample Rule
ValueOne exact value1 shows "Online"
RangeA span of numbersFrom 0 to 50 shows "Low"
RegexA text patternAnything matching err.* shows "Error"
SpecialNull, NaN, true, false, or emptyNull shows "No Data"

Build a Server Status Panel

Follow this sample to build a clear status tile.

  1. Create a Stat panel with a query that returns 1 when a server answers and 0 when it does not.
  2. Open Value mappings and click Add value mappings.
  3. Add a Value rule: 1 displays "Online" in green.
  4. Add a second Value rule: 0 displays "Offline" in red.
  5. Add a Special rule: Null displays "Unknown" in grey.
  6. Set Color mode to Background so the whole tile changes colour.
+----------------+   +----------------+   +----------------+
|                |   |                |   |                |
|    Online      |   |    Offline     |   |    Unknown     |
|     (green)    |   |     (red)      |   |     (grey)     |
+----------------+   +----------------+   +----------------+
   web-server-1         web-server-2         web-server-3

Tips for Clean Results

  • Limit a panel to three colours. More colours blur the message.
  • Keep green for healthy states and red for urgent states across every dashboard. Consistent colours build instant recognition.
  • Choose colour-blind friendly shades when your audience is broad, and pair colour with words through value mappings.
  • Match thresholds to real service promises, not guesses. Ask the owners of the service which numbers matter.