Aggregate metrics

Aggregate metrics

Chronosphere ingests metrics from many sources. These sources can supply multiple metric types, and are generally ingested as raw data.

Although raw data might provide detailed information about a specific point in time, that data grows rapidly and is expensive to store. Control costs by aggregating and downsampling your data.

Aggregation rules

Aggregation rules combine downsampling (lower sampling rate of metrics) and aggregation (focusing on the metrics important to a use case) to reduce the quantity of stored metrics data, and improve the performance of queries.

Chronosphere offers these types of aggregation rules:

  • Rollup rules aggregate metric data by grouping based on a label or downsample metric data in memory on the streaming ingest path before storing the results in the database. Rollup rules perform better, are more scalable, and require fewer steps to create aggregations.
  • Recording rules ingest the raw metric data first before reading it and then storing the aggregated and downsampled metric data back into the database. Recording rules are backward-compatible with Prometheus setups and support all PromQL functions.
  • Mapping rules downsample in-memory metric data on the streaming ingest path before storing any results in the database. The interval is the time between aggregated data points.

Review your metrics to determine if they're useful because they have references, or because some of their labels may be useful (dimensions).

To step through this process, see Reducing cardinality.

Compare data reduction methods

The following chart compares different methods of reducing incoming or persisted data. Your system needs might dictate a particular use, or indicate changing from one method to another.

Derived metrics and drop rules aren't aggregation rules, but their purpose is to reduce incoming data or cardinality.

Rule TypePurposeBenefits
Drop rulesDrop unused metrics.Fast, persisted data reduction with quick implementation.
Rollup rulesReduce cardinality, downsample data, and perform simple aggregations.Scalable, can drop raw data, and handle late arriving data.
Mapping rulesDownsample or drop metrics.Scalable downsampling of unaggregated metrics.
Recording rulesImprove query performance by pre-executing queries.Execute any PromQL query and add labels.
Derived metricsExecute complex queries in real-time.Replaces most recording rule use cases and doesn't add new time series.

Drop rules apply during collection, rollup and mapping rules apply during aggregation, and derived metrics and recording rules apply at query time.

View your aggregation rules

View, sort, and filter existing rollup and mapping rules from the Aggregation Rules page in the Chronosphere app.

Retention policies

Retention policies define the length of time Chronosphere retains metrics data. To view your retention policies, you must have administrative privileges.

  1. In the navigation menu, click Go to Admin.
  2. Select Control > Ingest Configuration.

Contact Chronosphere Support to configure the intervals used for your system. These policies might be based on your contract or license.

For example, your system's retention policies might look like:

  • Five days for raw data, and resolutions of 15, 30, and 60 seconds.
  • 120 days for one-minute data.
  • 180 days for one-hour data.
  • 1825 days for 24-hour data.

Rules use the existing, configured set of intervals in rule definitions.

Boilerplate rules

Chronoctl provides boilerplate code for you to base aggregation rules upon. Use the following command to generate the boilerplate:

chronoctl mapping-rules scaffold
chronoctl recording-rules scaffold