Visualizing monitoring data
easy 28 minA dashboard answers questions at a glance: is it fine, since when, and where is the problem?
See it run
Build a page that answers in seconds, choose charts by the question, and see how pictures can hide the truth.
Operations
Build a dashboard
Seven steps for one service.
Step 1 of 7
Metrics
| Panel 1 | Panel 2 | Panel 3 | Panel 4 | |
|---|---|---|---|---|
| top | ||||
| row 1 | uptime | req/s | errors | P99 |
| row 2 | ||||
| row 3 |
What to show
RED for the service: rate, errors, duration. And uptime.
Step 1: Metrics
metrics = ["uptime", "rate", "errors", "p99"]charts = {"now": "stat", "trend": "timeseries"}page = rows(stats, lines, tables)page.time, page.refresh = "1h", "30s"page.variables = ["service", "region"]page.alert("errors > 1% for 5m")page.share(team, runbook_link)- Answers
- Is it fine?
- Costs
- Nine panels
- Forty panels
- minutes to find the right one
If you cannot say which question a panel answers, remove it.
In the real world
The same visualizing monitoring data doing real jobs. Pick one and step through it.
The same incident without and with a mark.
Step 1 of 3
Errors rise
chart
14:30: errors up
Guessing
The line bends at 14:30. Nobody knows why.
Step 1: Errors rise
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Everything on one page
majorNobody finds the panel that matters.
Wrongpage.panels = all_metrics # 40Rightpage.panels = red(service) # 9A panel without the filter
criticalIt shows all services under the title of one.
Wrongrate(http_requests_total[5m])Rightrate(http_requests_total{service=~"$service"}[5m])Colour alone
majorMany people cannot tell red from green.
Wrongcell.color = "red"Rightcell.color, cell.text = "red", "critical"deriv on a counter
minorIt is made for gauges. A restart gives nonsense.
Wrongderiv(http_requests_total[5m])Rightrate(http_requests_total[5m])
Interview tips
Do
- Dashboards in version control.
- Variables for reuse.
- A description on each panel.
- A useful default range.
- Links to the next level.
Do not
- Pages without an owner.
- Heavy queries with a short refresh.
- Unrelated numbers in one chart.
- Forget to test speed.
- Forget access rights.
DASH
- Data: the right metrics.
- Arrange: order of importance.
- Style: colours, limits, words.
- Hook: alerts and actions.
Numbers
- Top left first.
- About 15 panels.
- Refresh 30 s to 5 min.
- Time series for trends, gauge for limits, stat for key numbers.