Query histogram and summary metrics
This page explains how to query OpenTelemetry histogram and summary metrics using MPL.
Unlike other OpenTelemetry (OTel) metric types, a histogram or summary metric doesn't hold a single measurement. Each one carries several components that mean different things, such as an observation count alongside a distribution. Query these metric types with a function that's aware of that shape, or by selecting the component you want.
Histogram metrics
Axiom stores each histogram metric as separate component series identified by reserved tags:
axiom.histogram: Identifies the component:count,sum,min,max, orbucket.axiom.le: Stores the bucket upper bound onbucketcomponent series.
The interpolate_ functions also support the tag names histogram and le instead of axiom.histogram and axiom.le.
Query histogram metrics with bucket and an interpolate_ function: interpolate_cumulative_histogram for cumulative temporality, or interpolate_delta_histogram for delta temporality. Each output series carries an axiom.bucket tag whose value is the requested spec (for example 0.99, avg, or count).
interpolate_cumulative_histogram(mode, specs)supports quantiles (between 0 and 1),count,sum, andavg. It doesn't supportminormax.interpolate_delta_histogram(specs)supports quantiles (between 0 and 1),count,sum,avg,min, andmax.minrequires recorded minimum values, andmaxrequires recorded maximum values. Quantiles require both.
For direct component queries (such as computing request rate from axiom.histogram == "count" or bucket distributions grouped by axiom.le), filter on axiom.histogram before applying align or group. For the bucket syntax, see Bucket. For examples, see Sample MPL queries.
Summary metrics
MPL has no interpolate_ function for summaries because the producer already computed the quantiles. Instead, select the component you want with the reserved axiom.summary and axiom.quantile tags, and derive anything else with compute.
Count and sum
Filter to the component you want.
Average
Divide the sum component by the count component with compute.
Minimum and maximum
If the producer emits the 0.0 and 1.0 quantiles, use them as the minimum and the maximum.
Quantiles
A summary only contains the quantiles the producer computed. You can select one of them, but you can't derive a quantile that isn't there.