I'm trying to add a custom dimension to my statsd metrics published to the cloudwatch unified agent. CW docs state that append_dimensions
under the metrics
section only supports InstanceId
, InstanceType
, AutoScalingGroupName
and ignores others.
CloudWatch Agent Configuration File: Metrics Secition:
append_dimensions – Optional. Adds Amazon EC2 metric dimensions to all metrics collected by the agent. The only supported key-value pairs are shown in the following list. Any other key-value pairs are ignored.
"ImageID":"${aws:ImageId}" sets the instance's AMI ID as the value of the ImageID dimension.
"InstanceId":"${aws:InstanceId}" sets the instance's instance ID as the value of the InstanceID >
dimension.
"InstanceType":"${aws:InstanceType}" sets the instance's instance type as the value of the > InstanceType dimension.
"AutoScalingGroupName":"${aws:AutoScalingGroupName}" sets the instance's Auto Scaling group name > as the value of the AutoScalingGroupName dimension.
The docs recommend adding append_dimensions
directly to the section defining the metrics you wish to use a custom dimension.
Adding Custom Dimensions to Metrics Collected by the CloudWatch Agent:
To add custom dimensions such as tags to metrics collected by the agent, add the append_dimensions field to the section of the agent configuration file that lists those metrics.
So I tried adding append_dimensions
to the statsd
section:
"statsd": {
"service_address": ":8125",
"metrics_collection_interval": 10,
"metrics_aggregation_interval": 60,
"append_dimensions": {
"Environment": "${APP_ENV}"
}
}
and I get the error:
Additional property append_dimensions is not allowed
I have tried sending tags with my metrics as well and they seem to be ignored.