Why doesn't my AWS metric have an average statistic form?
Some AWS metrics collected through CloudWatch may not always export an average statistic directly from the collector. This is because the OpenTelemetry Collector exports metrics using the statistic forms provided by AWS CloudWatch Metric Streams.
Available metric forms:
AWS CloudWatch provides the following statistic forms for most metrics:
min- Minimum valuemax- Maximum valuesum- Sum of all valuescount- Number of data points
To calculate the average:
You can calculate the average manually using the formula:
average = sum / count
This will give you the same result as the average statistic you would see in AWS CloudWatch console.
Example: EC2 CPU Utilization
For the aws_EC2_CPUUtilization metric:
- Use the formula:
aws_EC2_CPUUtilization_sum / aws_EC2_CPUUtilization_count - This calculates the average CPU utilization percentage
- The result matches the
averagemetric shown in CloudWatch
Why this approach?
The available metric forms (min/max/sum/count) follow the AWS CloudWatch Metric Streams standard. For detailed information about how these metrics are calculated and exported, refer to:
This approach allows you to:
- Migrate alarms that previously used the average statistic in CloudWatch
- Create custom calculations and aggregations
- Maintain the same monitoring functionality across platforms