Aggregate FunctionsPercentile & Sketch
otel_histo_percentile
Aggregate that merges OpenTelemetry histogram data points and extracts a
Syntax
otel_histo_percentile(histogram)Parameters
Prop
Type
Returns: real
Syntax
otel_histo_percentile(histogram, percentile)Parameters
Prop
Type
Returns: real
Examples
Example 1
OtelMetrics
| where metric_type == "histogram"
| summarize p99 = otel_histogram_percentile($raw, 99) by bin(timestamp, 1h)| timestamp (datetime) | p99 (real) |
|---|---|
| 2024-01-01T00:00:00Z | 948.8 |
Example 2
OtelMetrics
| where metric_type == "histogram"
| make-series p99 = otel_histogram_percentile($raw, 99) on timestamp
from datetime(2024-01-01) to datetime(2024-01-02) step 1h| timestamp (dynamic) | p99 (dynamic) |
|---|---|
| [2024-01-01T00:00:00Z,2024-01-01T01:00:00Z,2024-01-01T02:00:00Z,2024-01-01T03:00:00Z,2024-01-01T04:00:00Z,2024-01-01T05:00:00Z,2024-01-01T06:00:00Z,2024-01-01T07:00:00Z,2024-01-01T08:00:00Z,2024-01-01T09:00:00Z,2024-01-01T10:00:00Z,2024-01-01T11:00:00Z,2024-01-01T12:00:00Z,2024-01-01T13:00:00Z,2024-01-01T14:00:00Z,2024-01-01T15:00:00Z,2024-01-01T16:00:00Z,2024-01-01T17:00:00Z,2024-01-01T18:00:00Z,2024-01-01T19:00:00Z,2024-01-01T20:00:00Z,2024-01-01T21:00:00Z,2024-01-01T22:00:00Z,2024-01-01T23:00:00Z] | [948.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |
merge_tdigest
Merges multiple T-Digest sketches.
otel_histogram_merge
Merges OpenTelemetry histogram data points (explicit-boundary or exponential). Input is a dynamic propertybag containing histogram fields (e.g. $raw or pack_all()). Explicit histograms must have identical bucket boundaries to merge; mismatched boundaries return null. Exponential histograms at different scales are automatically downscaled to the coarser scale for lossless merging. Mixing explicit and exponential histograms returns null. Non-histogram rows are silently skipped.