Visualizing monitoring data
easy 28 minA dashboard answers questions at a glance: is it fine, since when, and where is the problem?
Video lesson · Chapter 1 of 6
Start from a service question
Theory
Read or listen first. About 1 min.
What it is
Visualizing monitoring data means turning numbers over time into pictures that a person can read in seconds. A panel is one picture. A dashboard is a page of panels that together answer one kind of question.
A good dashboard is made for a reader with a question: somebody who was just called, a team that looks at its week, or a manager who wants to know whether the promise is kept.
Why it exists
People see a bend in a line long before they find it in a list of numbers. A picture shows patterns, such as the same spike at every full hour.
It gives a team one common view. Discussions begin with what happened and not with whose numbers are right.
It shortens repairs. But only if it is clear: a wall of forty equal charts makes people slower.
A short history
1786
William Playfair publishes the Commercial and Political Atlas with 43 charts of values over time.
July 1999
Tobias Oetiker releases RRDtool, which stores measurements and draws them.
2014
Grafana version 1 appears. Its author began with Kibana 3 and wanted editing to be easier.
Words to know
- Panel
- One picture with its query.
- Time series chart
- Values over time, usually as lines.
- Stat
- One large number, often coloured by a limit.
- Gauge
- One value on a scale with limits. Not the metric kind of the same name.
- Heatmap
- How values are spread, over time. Darker means more.
- Variable
- A choice at the top, such as service or region, used by all panels.
- Threshold
- A value at which the colour changes.
- Annotation
- A mark in time, such as a release.
- Recording rule
- A query calculated in advance and stored as a new series.
Understand it
Start here
The weather wall of a sailing club
The wall is for the person who must decide now.
| At the club | In the system |
|---|---|
| Green light | Stat panel for health |
| Dial | Gauge |
| Line of the wind | Time series |
| Red line | Threshold |
| Switch | Variable |
| Note | Runbook link |
The idea
Four reasons and three principles
Why a picture
Quick
One look instead of a list of numbers.
Patterns
Steps, spikes, daily waves.
Together
The same picture for all teams.
Faster repair
Where to look next is visible.
| Principle | Meaning |
|---|---|
| Order | The most important at the top left |
| Context | Limits, history, comparison with last week |
| Action | Every panel answers a question somebody asks |
Which numbers belong on it is decided before: rate, errors and duration for services, utilization, saturation and errors for resources. See monitoring basics.
Charts
Which chart for which question?
| Chart | Question | Examples |
|---|---|---|
| Time series | How does it change? | Request rate, error share, P99 |
| Stat | How is it now? | Availability 99.97%, active users |
| Gauge | How close to the limit? | Disk used, CPU, queue length |
| Heatmap | How is it spread over time? | Duration buckets, errors by hour |
| Table | Which one exactly? | Slowest routes, services compared |
| Bar chart | Which is larger? | Requests by region, errors by type |
Choose the chart
A table panel
| Service | Requests a second | Errors |
|---|---|---|
| api | 1,200 | 0.1% |
| web | 800 | 1.2% |
| db | 2,400 | 5.0% |
Pie charts make it hard to compare slices. With more than five parts use bars. Time never belongs in a pie.
A heatmap shows what a P99 line hides: two groups of users, one fast and one slow, or a thin layer of very slow requests above a fast mass.
Page
A layout that works
Where a picture comes from
| Row | Shows | Chart |
|---|---|---|
| 1 | Availability, requests a second, error share, P99 | Four stats |
| 2 | Rate, errors, duration over time | Three time series |
| 3 | By route, by status code | Tables or bars |
Four levels of detail
| Level | Question | Where |
|---|---|---|
| 1 | Is it fine? | Stats, seen first |
| 2 | How does it change? | Time series |
| 3 | Which route is slow? | Tables |
| 4 | What happened at 14:34? | Logs and traces, one click away |
From the call to the cause
Three kinds of dashboard
| Kind | Content | For |
|---|---|---|
| Service | RED of one service | Developers |
| SLO | Budgets, availability | Operations and managers |
| Infrastructure | USE of machines | Platform team |
The last level is explained in inside a logging service. Grafana's own advice says the same: USE tells how happy your machines are, RED how happy your users are, and alerts should be on symptoms.
Reuse
Variables
| Variable | Values |
|---|---|
$service | api-gateway, user-service, payment |
$environment | prod, staging, dev |
$region | us-east, eu-west, ap-south |
sum by (service) ( rate(http_requests_total{service=~"$service", region=~"$region"}[$__rate_interval]))$__rate_interval chooses a window that fits zoom and scrape interval.Design
Make it readable
Do
- Important things at the top left.
- The same colours everywhere.
- Limits that show what is normal.
- Links to runbooks and details.
- Units on every axis: req/s, %, ms.
Do not
- More than about 15 panels.
- Pies with more than five parts.
- Numbers that do not belong together in one chart.
- All colours of the rainbow.
- A default range that fits nobody.
| Colour | Meaning | Also say it with |
|---|---|---|
| Green | Fine | The word OK |
| Yellow | Look at it | The word warning |
| Red | Act | The word critical, a thicker line |
| Blue | Neutral | Nothing |
How a chart can lie
| Trick, often by accident | Better |
|---|---|
| Axis from 99.0 to 100 without saying so | Show the range in the title |
| Two axes with two units | Two charts, one above the other |
| Stacked areas of shares | Lines |
| Average over long blocks | Maximum beside the average |
| Gaps drawn as a line or as zero | Show the gap |
Detail
The spike that disappeared
A chart has about a thousand points. A day with a sample every 15 seconds has 5,760. So several samples become one point. With the average, a short spike shrinks.
Samples per point
Show maximum and average, or a percentile that is calculated over the whole window. Zoom in before you say that nothing happened.
The window of a rate matters too. With a window of 5 minutes a spike of 10 seconds is spread over 5 minutes. A window shorter than two scrape intervals shows nothing at all, because a rate needs two samples.
Cost
Dashboards are load
Queries a second
| Expensive | Cheaper |
|---|---|
| Refresh every 5 s | 30 s to 5 min |
| Range 30 days by default | Last hour |
| P99 over all series at each view | A recording rule |
| 40 panels on one page | Rows that load when opened |
| A table of all routes | The ten largest |
groups: - name: payment rules: - record: service:http_errors:share5m expr: | sum by (service) (rate(http_requests_total{status=~"5.."}[5m])) / sum by (service) (rate(http_requests_total[5m]))Care
Dashboards as code
- 1
Choose the question
Who reads this, in which situation?
- 2
Build
Metrics, charts, layout, ranges, variables.
- 3
Limits and links
Thresholds, alert rules, runbook.
- 4
Review
JSON in version control, like any code.
- 5
Share
Rights by team, links in runbooks, the owner's name on the page.
- 6
Delete
Nobody opened it for three months? Ask, then remove.
Life of a dashboard
Does this panel stay?
Tools
Programs and their languages
| Tool | Known for | Mind |
|---|---|---|
| Grafana | Many sources, alerting, dashboards as JSON | Takes time to learn |
| Kibana | Exploring logs (Discover), quick charts (Lens) | Tied to Elasticsearch. Canvas only for upgraded installations that already use it |
| Datadog | Metrics, logs and traces as a service | Cost grows with volume |
| New Relic, Splunk | Application monitoring; search over machine data | Compare prices for your volume |
| Language | Used in | Example |
|---|---|---|
| PromQL | Prometheus, Grafana | rate(http_total[5m]) |
| KQL | Kibana | status:500 and service:api |
| LogQL | Loki | {job="api"} |= "error" |
Summary
The whole topic in one minute.
Choose the question, then the chart. Health at the top left, trends below, tables at the bottom, logs one click away. Show limits, units and releases, and never colour alone.
Dashboards are code: reviewed, owned, few. They explain alerts and do not replace them. Keep queries cheap, because many people open them at the worst moment.
- Question first, chart second.
- Health, trends, details, logs.
- Units, limits, releases on every chart.
- Never colour alone, never the average alone.
- Variables instead of copies, recording rules instead of heavy queries.
- Owner, review, deletion.