Berserk Docs
Aggregate FunctionsPercentile & Sketch

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.

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":[11,34,58,47,25],"count":175,"explicit_bounds":[10.0,50.0,100.0,200.0],"max":980.0,"min":1.2,"sum":17000.0,"type":"histogram"}948.8

On this page