Data Aggregation Concepts
Sysdig agents collect 1-second samples and report data at 10-seconds resolution. It is the lowest resolution at which backend stores the data. In order to do so, the agent performs the downsampling from 1-second to 10-second samples.
Note: This is true for all the metrics, except Prometheus. For Prometheus metrics, data is sampled at every 1 second, but what is reported in the 10-seconds interval is the lastest value, not the downsample.
Samples are initially stored on the lowest supported resolution of 10-seconds, after which samples are being rolled up to higher downsampled timelines periodically, as new data arrives. For example, the data registered at every 10 seconds is rolled up in blocks of 1-minute interval, and the data stored in blocks of 1-minutes is being rolled up to 10-minutes blocks.
Downsampling refers to the process of aggregating multiple samples, on defined time interval, into set of values which can provide estimation for aggregated time ranges. In Sysdig parlance, downsampling is nothing but the data aggregation performed by the backend before exposing it as time aggregation on the UI or by the API. In effect, the data available for time aggregation during query evaluation is not the raw data, but the values that represent the estimated values for the given time range.
Reducing the amount of samples also help reduce data retention costs as well as improve query performances by reducing the amount of data loaded during query evaluation.
Downsampled data is used only for longer time ranges. If you are viewing most recent data, such as 10 minute or last 1 hour, raw data is used for evaluation.
Sysdig Monitor rolls up historical data over time.
Sysdig downsampling produces data rollups of aggregated samples. In each data rollup, Sysdig calculates and records 4 values:
count. These values allow for exposing the following time aggregations:
rateOfChange on the UI as well as by the APIs.
For example, the data collected every 10-seconds is aggregated and rolled up in blocks of 1-minute interval. From the recorded values in 1-minute rollups, data is rolled up again for a block of 10-minutes interval.
Data resolution is the frequency with which the data is displayed. Sysdig Monitor supports the data resolution of 10 seconds, 1 minute, 10 minutes, 1 hour, and 1 day.
Time and Group Aggregations
There are two forms of aggregation used for metrics in Sysdig: time aggregation and group aggregation. Time aggregation is always performed before group aggregation.
Time aggregation comes into effect in two situations (that can sometimes overlap):
- Aggregation: Graphs can only render a limited number of data points. To look at a wide range of data, Sysdig Monitor aggregate granular data into larger blocks of samples for visualization as given in Data Downsampling.
- Data Rollup: Sysdig retains rollups based on each aggregation type to allow users to choose which data points to utilize when evaluating older data.
|average||The average of the retrieved metric values across the time period.|
|rate||The average value of the metric across the time period evaluated.|
|maximum||The highest value during the time period evaluated.|
|minimum||The lowest value during the time period evaluated.|
|sum||The combined sum of the metric across the time period evaluated.|
Difference Between Rate and average
Rate and average are very similar and often provide the same result. However, the calculation of each is different.
If time aggregation is set to one minute, the agent is supposed to retrieve six samples (one every 10 seconds).
In some cases, samples may not be there, due to disconnections or other circumstances. For this example, four samples are available. If this was the case, the
averagewould be calculated by dividing by four, while the
ratewould be calculated by dividing by six.
Most metrics are sampled once for each time interval, resulting in average and rate returning the same value. However, there will be a distinction for any metrics not reported at every time interval. For example, some custom statsd metrics.
Rate is currently referred to as
timeAvgin the Sysdig Monitor API and advanced alerting language.
By default, average is used when displaying data points for a time interval.
Time Aggregation on the UI
On the Sysdig Monitor UI, you select the time aggregation from the Metric drop-down.
Depending on the time range you have selected, how old the data is, and what the resolution is , panels display data at a granularity of 10 seconds, 1 minute, 10 minute, 1 hour, and 1 day.
The data drawn at 10-second resolution is reported every 10-second with the available aggregations (average, rate, min, max, sum) to make them available via the Sysdig Monitor UI and the API. For time series panels covering 5 minutes or less, data points are drawn at this 10-second resolution, and any time aggregation selections will have no effect.
When a panel displays an amount of time greater than
5 minutes, data points are drawn as an aggregate for
an appropriate time interval. For
example, for a panel covering 1 hour, each data point would reflect a 1-minute interval.
At time intervals of 1-minute and above, charts can be configured to display different aggregates for the 10-second metrics used to calculate each datapoint.
Time Aggregation and Time Range Mapping on the UI
|Aggregation Interval||Time Range|
|10-minutes||6 Hours, 12 Hours|
|1-hour||1 Day, 4 Day, 1 Week|
Metrics applied to a group of items (for example, several containers, hosts, or nodes) are averaged between the members of the group by default. For example, three hosts report different CPU usage for one sample interval. The three values will be averaged, and reported on the chart as a single datapoint for that metric.
There are several different types of group aggregation:
|average||The average value of the interval’s samples.|
|maximum||The maximum value of the interval’s samples.|
|minimum||The minimum value of the interval’s samples.|
|sum||The sum of values of all of the interval’s samples.|
If a chart or alert is segmented, the group aggregation settings will be utilized for both aggregations across the whole group, and aggregation within each individual segmentation.
For example, the image below shows a chart for CPU% across the infrastructure:
When segmented by
proc_name, the chart shows one CPU% line for each
Each line provides the average value for every process with the same name. To see the difference, change the group aggregation type to sum:
The metric aggregation value showed beside the metric name is for the
time aggregation. While the screenshot shows
AVG, the group
aggregation is set to
The tables below provide an example of how each type of aggregation works. The first table provides the metric data, while the second displays the resulting value for each type of aggregation.
In the example below, the CPU% metric is applied to a group of servers
webserver. The first chart shows metrics using average
aggregation for both time and group. The second chart shows the metrics
using maximum aggregation for both time and group.
For each one minute interval, the second chart renders the highest CPU
usage value found from the servers in the
webserver group and from all
of the samples reported during the one minute interval. This view can be
useful when searching for transient spikes in metrics over long periods
of time, that would otherwise be missed with average aggregation.
The group aggregation type is dependent on the segmentation. For a view
showing metrics for a group of items, the current group aggregation
setting will revert to the default setting, if the
selection is changed.