Metrics: Numeric measurements over time. CPU usage, request latency, error rates. Good for alerting and dashboards.
Logs: Timestamped text records. Good for debugging specific issues. Can be structured (JSON) or unstructured.
Traces: Request paths through distributed systems. Shows how a request flows across services.
When to use each:
- Metrics: "Is the system healthy?"
- Logs: "What happened at : PM?"
- Traces: "Why was this specific request slow?"
Interview tip: Metrics are cheap to store, logs are expensive. Plan storage carefully.