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.
Note: for cumulative-temporality histograms, merged.count is the sum of cumulative
snapshots in the bin, not a per-bin observation delta. Use otel_histogram_rate($raw)
for per-bin observation rate.
otel_histogram_merge is itself an aggregate: use it directly as a summarize
output — never nested inside another aggregate. Its merged result feeds the
scalar otel_histogram_percentile in a later extend.
Syntax
otel_histogram_merge(histogram)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1
OtelMetrics
| where metric_type == "histogram" and metric_name == "http.request.duration"
| summarize merged = otel_histogram_merge($raw) by bin(timestamp, 1h)
| extend p99 = otel_histogram_percentile(merged, 99)| timestamp (datetime) | merged (dynamic) | p99 (real) |
|---|---|---|
| 2024-01-01T00:00:00Z | {"bucket_counts":[33,90,152,109,66],"count":450,"explicit_bounds":[10.0,50.0,100.0,200.0],"max":980.0,"min":1.2,"sum":46800.0,"type":"histogram"} | 932.7272727272727 |