AlgoViz

Visualizing monitoring data

easy 28 min

A 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 1Panel 2Panel 3Panel 4
top
row 1uptimereq/serrorsP99
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

Releasenot shownPaymenterrors 4%On call

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

    major

    Nobody finds the panel that matters.

    Wrong
    page.panels = all_metrics   # 40
    Right
    page.panels = red(service)  # 9
  • A panel without the filter

    critical

    It shows all services under the title of one.

    Wrong
    rate(http_requests_total[5m])
    Right
    rate(http_requests_total{service=~"$service"}[5m])
  • Colour alone

    major

    Many people cannot tell red from green.

    Wrong
    cell.color = "red"
    Right
    cell.color, cell.text = "red", "critical"
  • deriv on a counter

    minor

    It is made for gauges. A restart gives nonsense.

    Wrong
    deriv(http_requests_total[5m])
    Right
    rate(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.