Interview Prep/SRE & Reliability/Observability & Telemetry Decisions

A developer adds `customer_id` as a label to a request counter "for better debugging". You catch it in code review. What do you say?

BeginnerScenarioObservability & Telemetry Decisions
Answer

Situation read → Unbounded label values create one time series per customer per route per status code. With a million customers that is millions of series and a Prometheus OOM waiting to happen.

What I'd do →

  1. Explain the cardinality math: routes x codes x methods x customers.
  2. Keep metric labels bounded: route template, method, status class, region.
  3. Put customer_id in logs and as a span attribute on traces, where high cardinality is cheap.
  4. If per-customer SLOs are truly needed (enterprise tenants), use a bounded tier or tenant label for the top 50 accounts and "other" for the rest.
  5. Add a CI or scrape guard: sample_limit on the ServiceMonitor and a promtool/lint rule for forbidden labels.

Why → Metrics answer "how much and how often"; logs and traces answer "which one". Mixing them breaks the metrics system.

Interview tip → "Metrics for aggregates, traces and logs for identities" is a clean one-liner.

All SRE & Reliability questions

More on Observability & Telemetry Decisions