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.
avg Syntax
avg [by FIELD [, FIELD, ...]]
avg 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