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 →
- Explain the cardinality math:
routes x codes x methods x customers. - Keep metric labels bounded: route template, method, status class, region.
- Put
customer_idin logs and as a span attribute on traces, where high cardinality is cheap. - If per-customer SLOs are truly needed (enterprise tenants), use a bounded
tierortenantlabel for the top 50 accounts and "other" for the rest. - Add a CI or scrape guard:
sample_limiton the ServiceMonitor and apromtool/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.
More on Observability & Telemetry Decisions
Your team has metrics and logs but no tracing. A request to checkout fans out to 9 services and nobody can tell where the 2 seconds go. How do you introduce tracing?IntermediateThe monthly observability bill doubled in two months and finance wants it cut by 40%. What do you do?IntermediateYou need to pick a trace sampling strategy for a service doing 20,000 requests per second.AdvancedEvery team has built their own Grafana dashboards with different panels. During incidents, nobody can find anything.BeginnerA service's logs are unstructured strings like `Order 123 failed for user 9 after 3 retries`. Searching them during incidents is painful.BeginnerYour Prometheus is a single instance holding everything. It is at 90% memory and the team wants 13 months of retention for SLO reports.Advanced