Full answer
Metrics
- Counters (requests total), gauges (queue length), histograms (latency distribution).
- Aggregated and cheap: one number per series per interval, regardless of traffic.
- Answer: "Is the error rate above 2%? Is p99 latency rising?"
- Basis for alerts and SLOs. A common starting set per service is RED: Rate, Errors, Duration.
- Keep label cardinality low; a label per user ID creates millions of series.
Traces
- A trace is the path of one request through many services. Each step is a span with start time, duration, service name and attributes; spans form a tree through parent IDs.
- Context (the trace ID) travels in request headers (the W3C
traceparentheader) so each service can attach its spans. - Answer: "This checkout took 3 seconds; 2.6 of them were in the inventory service waiting on the database."
- Usually sampled (for example 1% of requests, plus all errors and slow requests) to control cost.
Logs
- Timestamped records of events, best written as structured JSON:
{"level": "error", "msg": "payment declined", "order_id": "o_55", "trace_id": "4bf9..."}. - Answer: "Why did this request fail? What exact error did the payment provider return?"
- The most detailed and most expensive at scale; set retention and log levels deliberately, and never log secrets or full card numbers.
Working together in an incident
- An alert fires: checkout error rate is 5% (metric).
- The dashboard shows errors started at 10:42, only in one region (metric labels).
- An exemplar or trace search finds failed checkout traces; they show the error comes from the inventory service's database call (trace).
- Logs filtered by those trace IDs show "connection pool exhausted" after a deploy at 10:40 (log).
- Roll back the deploy; the error rate returns to normal.
Tools
OpenTelemetry provides standard SDKs and a collector for all three signals, so you can send them to Prometheus and Grafana, Jaeger or Tempo, Elasticsearch or Loki, or a commercial platform without changing application code.
Observability versus monitoring
Monitoring checks known failure conditions. Observability means having enough rich data to answer new questions about failures nobody predicted.
By level
Fresher: Explain metrics as numbers on dashboards, traces as the journey of one request, and logs as detailed messages. A fresher should say which one fires alerts.
Mid: Describe RED metrics, span trees and context propagation, structured logs, and a correlated incident workflow. Mention sampling.
Senior: Discuss cardinality control, tail-based sampling, retention and cost, SLO-based alerting and OpenTelemetry pipelines. Expect a practised incident narrative.
Key points
- Metrics show that something is wrong, cheaply
- Traces show where in a request path the problem is
- Logs explain why, with full detail
- Shared trace IDs link all three
- OpenTelemetry standardises collection
Common mistakes
- Logging everything at debug level in production
- Putting user IDs or request IDs in metric labels
- Tracing without propagating context between services
- Logging secrets or personal data
Follow-ups
- How would you choose a trace sampling strategy?
- What is an SLO and how do metrics support it?
- How do you control log storage costs?
Tips
- Give one question each pillar answers
- Walk through a short incident using all three
- Mention correlation by trace ID
Evaluation rubric
- Correct description of each pillar
- Clear use of each in practice
- Explains correlation between them
- Awareness of cost and cardinality