# Observability: Logs, Metrics and Traces

> Make a distributed system understandable with structured logs, metrics, distributed tracing, dashboards and alerts that point to real user impact. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/system-design/observability
Last updated: 2026-11-28

Make a distributed system understandable with structured logs, metrics, distributed tracing, dashboards and alerts that point to real user impact.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Service Communication and Discovery](https://www.internhack.in/roadmaps/tracks/system-design/service-communication)

You cannot fix what you cannot see. **Observability** is the ability to understand what a system is doing from the data it emits, especially for problems you did not predict.

### The three pillars

- **Logs**: timestamped event records. Make them **structured** (JSON with fields like request_id, user_id, latency_ms) so they can be searched and aggregated. Centralise them (ELK/OpenSearch, Loki, CloudWatch).
- **Metrics**: numeric time series such as request rate, error rate, latency histograms, queue depth, CPU. Cheap to store and great for dashboards and alerts (Prometheus plus Grafana is a common open-source stack).
- **Traces**: follow one request across services. Each hop is a **span** with timing; a shared **trace ID** links them. Shows which service made a request slow. **OpenTelemetry** is the vendor-neutral standard for emitting all three.

### What to measure

- **RED** for services: Rate, Errors, Duration.
- **USE** for resources: Utilisation, Saturation, Errors.
- **Four golden signals** (Google SRE): latency, traffic, errors, saturation.
- Business metrics too: orders per minute, payment success rate. A drop here is often the first sign of trouble.

### Alerting

Alert on **symptoms users feel** (error rate above SLO, p99 too high), not on every CPU spike. Every alert should be actionable and link to a runbook. Too many alerts teach on-call engineers to ignore them.

### Pitfalls

- Logging everything at INFO and paying a fortune to store noise; logging personal data like phone numbers and card details.
- High-cardinality labels (user_id) on metrics, which explode storage.
- Traces that break at every queue because context is not propagated through message headers.

You are ready to move on when you can instrument a two-service app so that one slow request can be found from a dashboard, followed through a trace and matched to its logs by trace ID.

## Key concepts

- **Structured logging**
- **Metrics and histograms**
- **Distributed tracing**
- **OpenTelemetry**
- **RED, USE and golden signals**
- **Symptom-based alerting**
- **Prometheus and Grafana**

## Mini project

Instrument two services with OpenTelemetry, export traces to Jaeger, metrics to Prometheus and logs with trace IDs. Build a Grafana dashboard with RED metrics and an alert, then inject latency and find the culprit using only your tools.

## Check yourself

Why should alerts fire on user-facing symptoms such as error rate rather than on causes such as high CPU?

## Free resources

- [OpenTelemetry documentation](https://opentelemetry.io/docs/) (OpenTelemetry)
- [Prometheus overview](https://prometheus.io/docs/introduction/overview/) (Prometheus)
- [Monitoring distributed systems](https://sre.google/sre-book/monitoring-distributed-systems/) (Google SRE)

Previous: [Reliability Patterns](https://www.internhack.in/roadmaps/tracks/system-design/reliability-patterns) · Next: [Availability, SLOs and Disaster Recovery](https://www.internhack.in/roadmaps/tracks/system-design/availability-and-disaster-recovery)

## More in Reliability, Observability and Security

- [Reliability Patterns](https://www.internhack.in/roadmaps/tracks/system-design/reliability-patterns)
- [Observability: Logs, Metrics and Traces](https://www.internhack.in/roadmaps/tracks/system-design/observability)
- [Availability, SLOs and Disaster Recovery](https://www.internhack.in/roadmaps/tracks/system-design/availability-and-disaster-recovery)
- [Security Basics for System Design](https://www.internhack.in/roadmaps/tracks/system-design/security-basics)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [System Design Roadmap](https://www.internhack.in/roadmaps/tracks/system-design)
