Question 1
Topic: Observability Concepts
Skill tested: Selects metrics, logs, and traces based on the operational question each can answer.
A payment service has intermittent latency spikes affecting only a small fraction of requests. The team currently records request totals and average latency, but the averages hide the affected requests. It must retain low-cardinality time-series data for SLO reporting, while engineers need to inspect the path and detailed events of an individual slow request. The application can add instrumentation, but the metrics backend should not receive request IDs or other per-request labels. Which approach best meets these requirements?
Latency metrics, particularly distributions such as histograms, support efficient aggregate analysis and SLO calculations. Traces preserve request-level context and spans, making them useful for following an individual slow request across operations. Adding request IDs as metric labels creates high-cardinality series and is unsuitable for Prometheus. Storing every event as a metric misuses the time-series model, while traces alone are generally not the preferred compact source for long-term aggregate service-level measurements.