Developers cannot connect a log line to the request that produced it across 6 microservices. What do you change?
IntermediateScenarioLogging Pipelines
Answer
Situation read → No shared correlation ID across services.
What I'd do →
- Adopt W3C Trace Context (
traceparentheader) via OpenTelemetry SDKs and auto-instrumentation. - Configure loggers to add
trace_idandspan_idfrom the active context to every line. - In Grafana, configure Loki derived fields to turn
trace_idinto a Tempo link, and Tempo "trace to logs" back. - Make gateways generate a trace ID if the client did not send one.
Why → One ID lets you follow a request from the edge through every service and its logs.
Interview tip → Say "logs, metrics and traces linked by trace_id", not three separate tools.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?Intermediate