m

Description

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.

Return type

float64

Domain

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

Categories

Usage

m(metricName, [ filter ])

Argument

Type

Optional

Repeatable

Restrictions

metricName

string

no

no

constant

filter

bool

yes

no

none

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.