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/Cloud
Cloudmedium

Metrics vs logs vs traces — how are they different?

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

Answer

Metrics are numbers over time (CPU, latency), logs are discrete events/messages, and traces follow a single request across services (spans). Together they help you detect, diagnose, and understand incidents.

Advanced answer

Deep dive

Think of observability signals as answering different questions:

  • **Metrics**: “Is the system healthy?” Aggregated numbers over time (RPS, p95 latency, error rate). Great for dashboards, SLOs, and alerting.
  • **Logs**: “What happened?” Discrete event records with context (userId, orderId). Great for debugging and audits.
  • **Traces**: “Where did time go?” A distributed view of a single request across services, broken into spans (DB call, HTTP call, cache).

How they work together

A common workflow: 1) Alert triggers from metrics (error rate spike). 2) Pivot to traces to find the slow/failing hop. 3) Read logs for the specific trace/request to see exact errors and context.

Practical tips

  • Put a correlation id / trace id into logs.
  • Avoid high-cardinality labels in metrics (cost + performance).
  • Use sampling for traces in high-traffic systems.

Common pitfalls

  • Logging too much at info level and exploding costs.
  • Missing structured logs (hard to query).

Related questions

Cloud
Observability: how do metrics, logs, and traces differ?
#cloud#observability#metrics
Cloud
What is a service mesh and when is it worth using?
#service-mesh#mtls#sidecar
Cloud
What is autoscaling and what is a common pitfall?
#autoscaling#metrics
  • Treating traces as a replacement for logs (they complement each other).
  • #thrashing
    Testing
    What does code coverage tell you and what does it not?
    #coverage#quality#metrics
    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