m(metricName: const string, [filter: bool]?) -> float64

Selects one scalar float64 metric series inside the align verb by metric name, pivoting the narrow metric table so that series becomes the expression’s value column for downstream aggregates. The metric name must be a compile-time string; an optional second argument is a boolean row filter evaluated per point after the name match. The input dataset must expose the metric interface (metric name column plus value column metadata). If the metric appears in dataset metadata, its type must be a float-backed metric type (gauge, cumulativeCounter, or delta); otherwise the compiler assumes float. For tdigest or object-shaped histogram metrics use m_tdigest, m_histogram, m_exponential_histogram, or m_object instead. Using m outside align is rejected.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

align 1m, frame(back: 1m), o: avg(m("cpu_utilization"))

Averages a float gauge metric after pivoting the metric table to expose cpu_utilization inside align.

align 5m, frame(back: 5m), o: sum(m("errors", region == "us-west-1"))

Sums an error counter series for one region by applying a tag filter on the metric selector.