avg Metrics Operator
The avg
operator calculates the average of all matching time series. If grouping is specified, it calculates the average for each group.
Syntax​
avg [by FIELD [, FIELD, ...]]
Examples​
Average value across all time series ​
This query returns the average value of the RequestCount
metric across matching time series. Â
Namespace=AWS/ApplicationELB metric=RequestCount Statistic=Sum AvailabilityZone=* Region=* TargetGroup=* | avgÂ
Â
Average by one field​
This query returns the average value of the RequestCount
metric by one field—TargetGroup
—across all matching time series, for the selected query range. Each line on the chart corresponds to a TargetGroup
.
Namespace=AWS/ApplicationELB metric=RequestCount Statistic=Sum AvailabilityZone=* Region=* TargetGroup=* | avg by TargetGroup
Â
Average by two fields​
Returns the average value of the metric by two fields—TargetGroup
and _sourceName
—across all matching time series, for the selected query range. Each line on the chart corresponds to a _resourceName-TargetGroup
combination.
Namespace=AWS/ApplicationELB metric=RequestCount Statistic=Sum AvailabilityZone=* Region=* TargetGroup=* | avg by TargetGroup, _sourceName