Skip to content

Metrics Aggregations

This section explains how KloudMate handles common metric types and how aggregation behaves in Explore.

KloudMate supports the following OpenTelemetry metric types:

  • Gauge
  • Sum
  • Histogram
  • Exponential Histogram
  • Summary

Refer to the OpenTelemetry Data Model for underlying data model concepts.

Both Delta and Cumulative temporalities are supported across all applicable metric types.

A metric query aggregates in two steps. Within series combines the points of each series into one value per interval. Across series then combines those series into the result the panel draws. These steps are also known as temporal and spatial aggregation.

A series is one combination of attribute values. For example, active_connections reported with a service attribute (checkout or payments) and a region attribute (us-east or eu-west) makes four series, one for each service in each region.

Raw points for four active_connections series, averaged within each series into one value per 5-minute interval, then summed across series by service into one series for checkout and one for payments

Choosing a single function such as Avg or Sum under Aggregate in the builder covers most queries. Click customize under Aggregate to pick the operation for each step yourself.

Aggregation within series reduces the points of one series in each interval to a single value. Interval sets the length of each interval. For example, with a 5-minute interval and a point every minute, each interval holds five points, and Avg returns their mean.

A point every minute for the checkout, us-east series, reduced by Avg to one point per 5-minute interval

Each series is aggregated on its own, so a query that matches four series still has four series after this step.

The right operation depends on the metric type. For a gauge, use Avg, Min, Max, or Last. For a sum such as a request counter, use Rate or Increase. Instant rate is offered only for cumulative counters.

Aggregation across series combines the series in each interval. Without Group by, every matching series is combined into one. For example, Sum adds the four active_connections series into a single total.

Four active_connections series added by Sum into one total series

To skip this step, choose Each series in the Group by list. Every series is kept apart with all of its labels, so Across series and Then aren’t available, while Rank still ranks the series one by one.

Group by keeps one result for each value of the attributes you pick, and combines only the series that share that value. For example, grouping by service adds the us-east and eu-west series of each service together, so the four series become two. The region attribute isn’t in the result.

Four active_connections series summed by service into one series for checkout and one for payments

Grouping by both service and region keeps all four series, because each series already has its own combination of the two.

To keep only the series whose value matches a condition between the two steps, use Where value.

In KMQL, each step is written in order. The query in the diagrams above reads active_connections | within avg | sum by service.