Observability: Logs, Metrics & Traces
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.
| Tool | Answers | Example | Cost |
|---|---|---|---|
| Logs | What event happened? | Booking failed with request ID | Storage, search, and privacy |
| Metrics | How often and how much? | Requests per second and error fraction | Many distinct labels increase storage |
| Traces | Where did one request spend time? | Database call took 410 milliseconds | Collection 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.
{
"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.
Examples
Spot a growing queue
Race-day dashboards show latency, traffic, errors, and chip-reader queue depth.
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 minutesFive 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.
Follow one missed booking
A resident’s booking crosses booking, routing, and driver-app services.
Booking, routing, and driver-app events all carry pickup-42, allowing one search to collect their related records.
Pass the ID into queued work too. Limit access and avoid personal data in IDs, because correlation IDs connect activity across services.
The insight
Correlation IDs connect the records needed to investigate a request.
Find the slow report step
A trace shows one database query used 900 milliseconds of a 1,000-millisecond report.
Report duration: 1000 ms
Database query: 900 ms
Share: 900 / 1000 = 90%
After indexing: measure the same query and report againUse Module 3’s query-plan checks before adding an index. Trace durations can overlap, so do not add nested timings as if they were separate waits.
The insight
Traces show where request time goes; measurements confirm the fix.
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
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.