Summary Metrics
What you'll learn: How summary metrics compute percentiles client-side and when to use them instead of histograms for tracking percentiles.
What Are Summary Metrics?
Summary metrics calculate percentiles (like p50, p90, p99) directly on the client before sending data to your monitoring system. Unlike histograms which send bucket counts and let the server calculate percentiles, summaries do the math locally and only transmit the final percentile values.
Think of it like this: a histogram is like sending your teacher all your test scores so they can calculate your class rank. A summary is like calculating your own rank and just telling the teacher "I'm in the 95th percentile."
How Summaries Work
When you record values to a summary metric, it maintains a sliding time window (e.g., last 5 minutes) and continuously calculates configured percentiles (p50, p90, p95, p99) from that data. Your monitoring system receives pre-computed percentile values, not raw observations.
Summaries vs Histograms: The Tradeoff
Advantages of summaries:
- Accurate percentiles for that specific service instance (no bucketing error)
- Lower storage cost on the monitoring backend (only sending a few percentile values)
- No configuration guesswork about bucket boundaries
Disadvantages of summaries:
- Cannot aggregate percentiles across multiple instances (you can't average p99s meaningfully)
- Higher CPU/memory cost on the client (maintaining time windows and sorting)
- Not queryable over arbitrary time ranges (only pre-computed windows)
When to Use Summaries
Use summaries when you need instance-level percentile accuracy and won't need to aggregate across services. Use histograms when you need fleet-wide percentile calculations or flexible time-range queries.
Key Takeaway: Summary metrics trade client-side computation for exact percentiles but sacrifice aggregation flexibility—choose histograms when you need to calculate percentiles across multiple services or custom time windows.