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

Select a metric for the align verb.

It works with metrics whose values are reported as float64, including all metrics of type cumulativeCounter, gauge or delta.

For tdigest metrics, please use m_tdigest(), instead. For OpenTelemetry histograms and exponential histograms, please use m_object(), instead.

Domain

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

Categories

Examples

align 5m, request_rate: rate(m("requests_total"))

Calculate the per-second rate for the selected metric "requests_total". The dataset must already implement the "metric" interface.

align 5m, request_rate: rate(m("requests_total", return_code >= 400 and return_code <= 599))

Calculate the per-second rate for the selected metric "requests_total" whose return_code is between 400 and 599. The dataset must already implement the "metric" interface.