A team wants to add debug logging to every request in production to troubleshoot an intermittent bug.
BeginnerScenarioObservability & Telemetry Decisions
Answer
Situation read → Debug logs for all traffic multiply log cost and can hurt performance; usually you only need them for a slice.
What I'd do →
- Enable debug dynamically for a subset: a header, a feature flag, or one canary pod.
- Use trace sampling with full attributes on errors instead.
- Set a time limit and an owner for the change.
- Make sure no secrets or PII appear in debug logs.
Why → Targeted debug data solves the bug without a cost spike or new risk.
Interview tip → Mention runtime log-level switching without redeploying.
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?IntermediateA developer adds `customer_id` as a label to a request counter "for better debugging". You catch it in code review. What do you say?BeginnerYou 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.Beginner