- Percentage of requests in the last hour, with response time 100ms or less
- How many HTTP responses were larger 4kb between 2:30 .. 2:45.
You have suitable / compatible buckets defined !
Calculating percentiles with "histogram_quantile" function
b/c
- accuracy depends on bucket layout
- need lot's of buckets for high accuracy
- but buckets are expensive
"Put buckets where you expect interesting values." e.g. SLA latency thresholds.
Also need compatible bucket layout...
All boils down to: Buckets are too expensive.
- partition request HTTP counts per status code
- collect only a single latency histogram for all status codes (because buckets are too expensive.)
Go to event processing system, if you need accurate results.
This get's increasingly annoying...
> Are we responding fast enough to 404 right now?
> Do the 501 and 503 requests take the same amount of time?
> How fast are my 200s while I have a 404 storm.
(1) Buckets are too expensive
(2) Ingestion Isolation
Option 1: Do nothing.
... is becoming increasingly unpopular.
> Instrumentation first, ask questions later.
For histograms this does not hold b/c need to know interesting values, don't have partitions, etc.
E.g. by improving the exposition format.Even with compression a single histogram with ~20 buckets takes ~300 bytes.
What can help:
- protobuf?
- more compact exposition format??
Problem: TSDB has 0-notion of histograms. Only groups of numeric metrics.
Worst bit: Bucket boundaries are in the metric name (string).
Lot's of room for improvement.
How about infinitely many buckets? each 5% larger than the next?
This has already been done in practice:
- HdrHistogram
- @circonus's Circllhist
- Datadog's DDSketch ("hot" but very simple)
Allows to handle sparseness!
If buckets are expensive ...
... maybe we should not have buckets.
Problem: High percentiles are not accurate enough.
... this is what motivated DataDog to write their sketch, which really is a histogram.
1. Master Sparseness Problem (with Histograms)
3. Make buckets a little cheaper
2. Digest/Sketches
4. Do nothing