Skip to main content
Query and analyze your OpenTelemetry metrics data using the Axiom Console. This page shows you how to extract insights from your metrics through filtering, aggregation, and transformation operations. For more information on working with metrics at Axiom, see Metrics overview.
Support for OTel metrics is currently in private preview. For more information, see Feature states.

Concepts

  • Dataset: A group of related metrics.
  • Metric: A measurement that tracks a specific aspect of your system over time.
  • Tag: A key-value pair identifying a series.
  • Series: A unique combination of a metric and tag set.

Build metrics query

To build a typical metrics query:
  1. Click the Query tab.
  2. Click Builder in the top left.
  3. In Dataset, define the source of your query. Select an OTel metrics dataset, and then select the metric you want to query.
  4. In Where, filter the results. Restrict the query to a set of series whose tag values match the conditions you specify.
  5. In Transformations, select the transformations you want to apply to the data.
  6. Click Run.

Example query

Example metrics query
This example queries the axiom-dev.metrics dataset’s alertmanager_alerts metric one hour before the current time. It filters results to events where k8s.namespace.name is monitoring and aggregates events over 30-second time windows into their average value.

Elements of queries

The following explains each element of a metrics query.

Source

Specify the dataset and the metric in the Dataset field. The dataset and metric names are separated by a colon in the Builder interface. For example, axiom-dev.metrics:alertmanager_alerts.

Filter

Use the Where section to filter series based on tag values.
  1. Click + in the Where section.
  2. Select the tag where you want to filter for values.
  3. Select the logical operator of the filter. Available operators are:
    • Equality: ==, !=
    • Comparisons: <, <=, >, >=
  4. Specify the value for which you want to filter.
  5. Click + to add another filter and join them with the logical and operator.
For example, the following joins three filters: project == /.*metrics.*/ and code >= 200 and code < 300.

Transformations

Use the Transformations section to transform individual values or series.
  1. Click + in the Transformations section.
  2. Select the transformation you want to apply to the data. Available transformations are:
    • map: Map the data to a new value using the expression you specify.
    • align: Aggregate data using the function and the time window you specify.
    • group: Group the data by a set of tags using the aggregation function you specify.

Map

Use map to transform individual values. Available mapping functions:
FunctionDescription
rateComputes the per-second rate of change for a metric.
absReturns the absolute value of each data point.
interpolate::linearLinear interpolation of missing values.
fill::prevFills missing values using the previous non-null value.
!Negates the value.
For example, to calculate rate per second for the metric, use map rate. To fill empty values with the latest value, use map fill::prev.

Align

Use align to aggregate over time windows. You can specify the time window and the aggregation function to apply. Available aggregation functions:
FunctionDescription
avgAverages values in each interval.
countCounts non-null values per interval.
maxTakes the maximum value per interval.
minTakes the minimum value per interval.
prom::ratePrometheus style rate
sumSums values in each interval.
For example, to calculate the average over 5-minute time windows, use align to 5m using avg. To count the data points in the last hour, use align to 1h using count.

Group

Use group to combine series by tags. You can specify the tags to group by and the aggregation function to apply. If you don’t specify tags, Axiom aggregates all series into one group. Available aggregation functions:
FunctionDescription
avgAverages values in each group.
countCounts non-null values per group.
maxTakes the maximum value per group.
minTakes the minimum value per group.
sumSums values in each group.
For example:
  • To calculate the number of series, use group using count.
  • To calculate the total number of nodes, use group using sum.
  • To group data by the project and namespace tags using the sum aggregation, use group by project, namespace using sum.