Video in progress

How do you build an observability strategy for a system with hundreds of services: what do you measure, and how do you control the cost of tracing?

The same base for every service: RED metrics (rate, errors, duration), SLOs by user journey, and alerts only on SLO violations. Storing everything in tracing is expensive: start with head sampling and move to tail-based sampling that keeps errors and slow requests.

📖 Answer

Observability is for one question: "what broke and where?", and the answer should come in minutes. In many companies it's the opposite: thousands of dashboards, hundreds of alerts, and nobody trusts them.

A standard base (the platform provides it). Every service emits identically named metrics: http.server.requests (Micrometer), DB pool, JVM, Kafka lag. The same dashboard template. When a new service is created, all of this exists automatically: the golden path.

SLOs by user journey. "Checkout is 99.9% successful and p95 < 800 ms". Not CPU or GC alerts inside a service. Alerts are set on error budget burn rate: if it burns fast, it wakes someone at night; if it burns slowly, a ticket during working hours. This cuts the number of alerts sharply.

The cost of tracing. Storing 100% of traces is expensive at high traffic: storage, network, collector CPU. Options:

  • head sampling (say 5%): cheap, but the trace of the rare error you need may get dropped;
  • tail-based sampling in the OpenTelemetry Collector: the decision is made after the trace is fully assembled, so error and slow traces are kept at 100% and the rest at 1–5%. The collector needs memory, and it needs load balancing by trace ID so all of one trace's spans land on one collector.

Logs. Structured JSON, with a traceId and the service version in every record. DEBUG is off by default in prod. Showing teams a "bill" for their log volume brings the cost down fast.

Signals should be linked. A spike in a metric → the exemplar trace from that time → that trace's logs. If moving between them takes one click in a single UI (Grafana: Prometheus/Mimir + Tempo + Loki, or something else), incident time goes down.

The measure of success: MTTD and MTTR. If you still learn about incidents from user complaints, the strategy isn't working.