Skip to interview prep
Apexed

48. What are logs, metrics and traces, and when do you use each?

EasyDebugging & production

Technical
Show model answer

Metrics are cheap numeric time series (request rate, error rate, latency percentiles, saturation) for dashboards and alerts. Logs are detailed event records for investigating specific cases. Traces follow one request across services to show where time is spent.

Alert on user-facing symptoms (error rate, latency against SLOs), then use traces and logs to find the cause. Use structured logs with request ids, and never log secrets or personal data.

What are logs, metrics and traces, and when do you use each — Software engineering interview question — Apexed