Logs, metrics and alerts

Intermediate 12 min read

See what production is doing, and be told when it needs you — before users have to.

Why it matters

Once software is live you cannot attach a debugger. Logs tell you what happened, metrics show trends, traces follow one request across services, and alerts wake someone only when users are affected.

Where it fits — Observability applies across these stages

  1. Plan & Design
  2. Develop
  3. Version control
  4. Verify
  5. Build & Package
  6. CI/CD
  7. ● Deploy
  8. ● Operate

What you will learn

  • Write useful, structured log lines without sensitive data.
  • Pick a few metrics that show whether users are served well.
  • Alert on symptoms users feel, not on every warning.

Before you start

Three signals

  • Logs — individual events with context: what happened, to which request, with which error.
  • Metrics — numbers over time: requests per second, error rate, response time, queue length.
  • Traces — the path of one request through several services, with the time spent in each.
Example
{"time":"2026-10-23T09:14:02Z","level":"error","request_id":"7f3a","route":"/api/orders","status":500,"message":"payment provider timeout"}
A structured log line: easy to search and count. No passwords, tokens or personal data.

Alerts people trust

Start with the symptoms users feel: errors, slow responses, the site being unreachable. Every alert should need a human action; an alert that is always ignored teaches people to ignore all of them.

  • Errors and slow requests are visible on one dashboard.
  • Someone is alerted when the error rate or response time stays high.
  • Backups run, and a restore has been tested.

Official documentation and references

Documentation

Guides

Learn next

Done with this topic?

Reviewed 2026-10-23. Links go to the official documentation unless marked otherwise.