Interview kitsBlog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2026 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Observability
Observabilityeasy

Logs vs metrics vs traces — when do you use each?

Tags
#observability#logs#metrics#tracing
Back to categoryPractice quiz

Answer

Logs show discrete events and context, metrics show aggregated trends over time, and traces show end-to-end request paths across services. Use logs for details, metrics for health/alerting, and traces for latency and dependency analysis.

Advanced answer

Deep dive

Each signal answers a different question:

  • Metrics: "Is the system healthy and how is it trending?" (SLIs, alerting, capacity).
  • Logs: "What exactly happened?" (error details, inputs, correlation IDs).
  • Traces: "Where is the time spent across services?" (latency breakdown, dependency hops).

Use them together: metrics trigger, traces narrow the path, logs give the exact error.

Examples

A slow request investigation:

Alert fires (p95 latency) -> trace shows slow DB span -> logs show slow query + params

Common pitfalls

  • Treating logs as metrics (expensive and noisy).
  • No correlation IDs, so logs can’t link to traces.
  • Missing RED/USE views, so you see symptoms but not cause.

Interview follow-ups

  • What would you alert on for a user-facing API?
  • How would you sample traces without losing critical data?
  • How do you control logging costs?

Related questions

Observability
Explain the RED and USE methodologies and when to use them.
#red#use#metrics
Observability
How do you investigate a latency regression in production?
#latency#incident#tracing
Observability
What is sampling in tracing and what are the trade-offs?
#tracing#sampling
#cost
Observability
How do you handle high-cardinality labels/tags in metrics?
#metrics#cardinality#labels
Observability
What is distributed tracing and how do you propagate context?
#tracing#context#distributed-systems
Testing
What does code coverage tell you and what does it not?
#coverage#quality#metrics