Metrics vs Logs
Compare numeric time series with event records for monitoring and troubleshooting.
| Dimension | Metrics | Logs | What it means in practice |
|---|---|---|---|
| Data shape | Numbers with labels sampled over time. | Timestamped text or structured events. | Metrics are aggregates; logs keep individual events. |
| Cost driver | Number of series (cardinality). | Volume of bytes ingested and retained. | Put per-request detail in logs, not metric labels. |
| Best for | Alerting, trends, dashboards, SLOs. | Investigating specific events and errors. | Alert on metrics, then use logs to explain. |
| Query style | PromQL-style aggregation over time. | Search and filter, then aggregate. | Log-based metrics can bridge the two. |
| Retention | Long retention is cheap after downsampling. | Long retention is expensive. | Keep high-value logs (audit, security) longer than debug logs. |
| Correlation | Exemplars and labels such as service. | trace_id and service fields. | Shared labels let you pivot between signals. |