Monitoring, Logging, and Observability

Three Pillars of Observability

PillarWhatTools
MetricsNumeric measurements over time (CPU, latency, error rate)Prometheus, Grafana, Datadog
LogsDiscrete events with context (structured JSON logs)ELK Stack, Loki, Splunk
TracesRequest path across services (distributed tracing)Jaeger, Zipkin, OpenTelemetry

Key Metrics (RED Method)

Distributed Tracing

Request: GET /checkout │ ├── API Gateway (5ms) │ └── Auth Service (10ms) ├── Order Service (50ms) │ ├── Inventory Service (20ms) │ └── Payment Service (100ms) ← BOTTLENECK! └── Notification Service (5ms) Trace shows: total 170ms, Payment is the bottleneck. Without tracing: "checkout is slow" — which service? Unknown.

Alerting

Alert on symptoms (high error rate, high latency), not causes (high CPU). High CPU with no user impact = not urgent.

Key Takeaways