System Design Academy

Saving…

Lesson 10 of 10 in Module 50 of 54 lessons complete

Observability: Logs, Metrics & Traces

Module 5, lesson 10Concept12 min

Definition

Observability

In plain English
Observability is how well you can understand what a system is doing from the data it produces.
Think of it like
It is like a car dashboard with gauges, warning lights and a trip log.

Logs, metrics and traces

In plain English
Logs are timestamped records of events, metrics are numbers measured over time, and traces follow one request across services.
Think of it like
It is like a ship's diary, its speed gauges and a tracking map of one voyage.

Alert on SLO

In plain English
Alerting on an SLO means paging people when users are actually affected, not for every small blip — SLOs were introduced in Module 2.
Think of it like
Like calling for help when the journey is disrupted rather than whenever a gauge flickers.

Saturation

In plain English
Saturation measures how much capacity is occupied or how much work is waiting to use it.
Think of it like
It is like seeing every checkout busy while a queue grows behind them.

Why it exists

A resident says a pickup booking is slow. You need to know whether the delay began at the gateway, routing service, or database.

Without connected records and measurements, you guess. With them, you can find the slow step and check whether the fix helped.

How it works

Golden signals

In plain English
The golden signals are latency, traffic, errors and saturation — the four measurements that best show a service's health.
Think of it like
Like pulse, breathing, temperature and blood pressure for a patient.

Correlation ID

In plain English
A correlation ID is a unique ID attached to a request and passed along so every log line about it can be found together.
Think of it like
Like a parcel tracking number.
ToolAnswersExampleCost
LogsWhat event happened?Booking failed with request IDStorage, search, and privacy
MetricsHow often and how much?Requests per second and error fractionMany distinct labels increase storage
TracesWhere did one request spend time?Database call took 410 millisecondsCollection and storage; sampling misses some requests
  • Latency: how long requests take; p99 is the duration at or below which 99% of measured requests finish.
  • Traffic: requests received per second.
  • Errors: failed requests divided by total requests.
  • Saturation: queued work or occupied capacity, such as queue depth or CPU use.
A structured event can be searched by request ID without logging a resident’s address.
JSON
{
  "timestamp": "2026-11-23T09:00:00Z",
  "correlation_id": "pickup-42",
  "level": "info",
  "service": "booking",
  "duration_ms": 465,
  "event": "request_completed"
}

A gateway spends twenty milliseconds on its own work, booking spends thirty-five, and a database call spends four hundred ten.

For sequential work here, the total is 465 milliseconds.

A gateway spends twenty milliseconds on its own work, booking spends thirty-five, and a database call spends four hundred ten.

Examples

Spot a growing queue

Race-day dashboards show latency, traffic, errors, and chip-reader queue depth.

A sustained rate difference estimates time until this queue fills.
Text
Arrival rate:  120 scans per second
Worker rate:   100 scans per second
Queue growth:   20 scans per second
6000 free queue slots / 20 = 300 seconds = 5 minutes

Five minutes is an estimate if those rates hold. Queue growth can warn before users notice, but detection does not guarantee enough recovery time.

The insight

Saturation can reveal approaching capacity problems.

Trade-offs

Pros

  • Shortens diagnosis.
  • Warns about approaching capacity limits.
  • Supports capacity planning.

Cons

  • Collection and storage cost money.
  • Noisy pages exhaust responders.
  • Logs can expose sensitive data.

Use when

  • A production service needs diagnosis.
  • Teams need evidence for capacity decisions.

Avoid when

  • Recording whole request bodies would expose personal data.
  • An alert has no useful action or owner.

Quick check

Which signal tells you how "full" a service is, like queue depth or CPU?
What links all log lines from one user request across five services?

Takeaways

  • Logs record events, metrics measure trends, and traces follow requests.
  • Watch latency, traffic, errors, and saturation.
  • Alert on user impact and connect diagnostic records with correlation IDs.

Try the quick check above whenever you feel ready.

Previous: Consensus with Raft