Metrics Aggregations
This section explains how KloudMate handles common metric types and how aggregation behaves in Explore.
Supported Metric Types
Section titled “Supported Metric Types”KloudMate supports the following OpenTelemetry metric types:
- Gauge
- Sum
- Histogram
- Exponential Histogram
- Summary
Refer to the OpenTelemetry Data Model for underlying data model concepts.
Temporality
Section titled “Temporality”Both Delta and Cumulative temporalities are supported across all applicable metric types.
How aggregation works
Section titled “How aggregation works”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.
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
Section titled “Aggregation within series”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.
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
Section titled “Aggregation across series”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.
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.
Keep one series per group
Section titled “Keep one series per group”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.
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.