---
title: Monitor aggregators
description: >-
  Learn how monitor aggregation methods (average, maximum, minimum, sum) affect
  alert behavior with examples and visual comparisons.
breadcrumbs: Docs > Monitors > Monitor Guides > Monitor aggregators
---

# Monitor aggregators

## Overview{% #overview %}

{% image
   source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/aggregator_dropdown.67c366ee0675309094319375ddbd8aff.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/aggregator_dropdown.67c366ee0675309094319375ddbd8aff.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Dropdown under Monitor Configuration showing the four aggregators" /%}

Configure your monitor query to send alerts based on how the data is aggregated with one of the four aggregation methods: average, maximum, minimum, and sum. For this guide, take the same example metric values over a 10 minute evaluation window and apply the different aggregators to see how each monitor would react.

{% image
   source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/metric_values_example.6afd8f227193b49343de20dbaab6bdca.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/metric_values_example.6afd8f227193b49343de20dbaab6bdca.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Example metric values over a 10 minute evaluation window [10, 15, 12, 8, 11, 14, 13, 25, 37, 45, 50]" /%}

All the examples assume that:

- Queries are calculated with the [`classic_eval_path`](https://docs.datadoghq.com/monitors/guide/as-count-in-monitor-evaluations.md#2-ways-to-calculate).
- The monitor alerts when the values are *above* a certain threshold.

## Average{% #average %}

The monitor takes the values in the evaluation window and calculates the average of all the data points. This average value is compared to the defined threshold. A common use case for this aggregator is checking if the metric data is too high or too low.

##### Example{% #example %}

You want a monitor to send a notification when the average over the past 10 minutes goes over 30. What state is the monitor in at minute 3:10?

$$(\10+15+12+8+11+14+13+25+37+45+50)/11 = 22$$

##### Answer{% #answer %}

**OK** state, this monitor is not going to alert.

## Maximum and above{% #maximum-and-above %}

The monitor takes the values in the evaluation window and compares **each value** against the defined threshold. If any single data point in the evaluation window is *above* the threshold, the monitor will alert.

For monitors configured to alert when *below* the threshold, the behavior is reversed.

##### Example{% #example-1 %}

1. You want a monitor to send a notification if at any point in the last 10 minutes the value of the metric is above 40. What state is the monitor in at minute 3:10?

1. You want a monitor to send a notification if at any point in the last 10 minutes the value of the metric is above 50. What state is the monitor in at minute 3:10?

##### Answer{% #answer-1 %}

1. **ALERT** state, the last two values in the past 10 minutes are 45 and 50. This monitor is going to alert.

1. **OK** state, the threshold is 50 and the last value is not above 50. This monitor is not going to alert.

## Minimum and above{% #minimum-and-above %}

The monitor takes the values in the evaluation window and compares **each value** against the defined threshold. All values in the window must be above the threshold. If the minimum value is *above* the threshold, that means all points in the window are also above the threshold.

For monitors that are configured to alert when *below* the threshold, the behavior is reversed.

##### Example{% #example-2 %}

You want a monitor to alert if the minimum metric value is above 10 at any point in the last 10 minutes. What state is the monitor in at minute 3:10?

##### Answer{% #answer-2 %}

**OK** state, the value at 3:00 (10) and 3:03 (8) is NOT above 10.

## Sum{% #sum %}

The monitor takes the values in the evaluation window and compares **the sum value** against the defined threshold. This aggregator adds the value of each data point, not the number of data points. A use case would be for a metric that counts occurrences of errors or restarts. This is why *as\_count()* metrics have to use the sum aggregator. For more information, see the [as_count() in monitor evaluations](https://docs.datadoghq.com/monitors/guide/as-count-in-monitor-evaluations.md) guide.

##### Example{% #example-3 %}

You want a monitor to send a notification when the sum of values over the past 10 minutes goes over 250. What state is this monitor in at minute 3:10?

$$10+15+12+8+11+14+13+25+37+45+50 = 240$$

##### Answer{% #answer-3 %}

**OK** state, this monitor is not going to alert.

## Visualizing aggregators{% #visualizing-aggregators %}

You can see different results depending on the aggregation method you are using in your query and your evaluation aggregation. The aggregation methods below use the same metric. You can see how each method affects the way the metric is aggregated in a timeseries.

| Aggregation                                         | Resulting graph                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Average (`avg by`): average value of the metric     | {% image
     source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/AVG_aggregation.828f375d7a3980c16fb4ac932866490e.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/AVG_aggregation.828f375d7a3980c16fb4ac932866490e.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Graph visualization of the metric aggregated by the average" /%}                                                                  |
| Maximum (`max by`): maximum value of the metric     | {% image
     source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MAX_aggregation.f7d6b6fdd1452e2125c0d389c2790c88.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MAX_aggregation.f7d6b6fdd1452e2125c0d389c2790c88.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Graph visualization of the metric aggregated by the maximum value, visually shows higher values than the average graph" /%}       |
| Minimum (`min by`): minimum value of the metric     | {% image
     source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MIN_aggregation.2987629a430657f9b9717e15eb61ea6d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/MIN_aggregation.2987629a430657f9b9717e15eb61ea6d.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Graph visualization of the metric aggregated by the minimum, visually shows lower values than the average and maximum graphs" /%} |
| Sum (`sum by`): total of all metric values added up | {% image
     source="https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/SUM_aggregation.5bcdba510a953b922be9eb95262a890d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/monitor_aggregators/SUM_aggregation.5bcdba510a953b922be9eb95262a890d.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="Graph visualization of the metric aggregated by the sum, visually shows higher values than the average and maximum graphs" /%}    |

## Further Reading{% #further-reading %}

- [Configure Monitors](https://docs.datadoghq.com/monitors/configuration.md)
