Fix CloudWatch agent custom dimensions not appearing in metrics #218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
environmentdimension not appearing in CloudWatch metricsInstanceIdandAutoScalingGroupNamedimensions to all metricsProblem
The global
append_dimensionsin CloudWatch agent config only supports these AWS metadata variables:${aws:InstanceId}${aws:InstanceType}${aws:ImageId}${aws:AutoScalingGroupName}Any other key-value pairs are silently ignored. Our custom
environmentdimension was not appearing in metrics.Solution
append_dimensionswithenvironmentto each metric type individually (cpu, mem, disk, diskio, netstat, processes, swap, procstat)append_dimensionsfor the supported AWS variables (InstanceId, AutoScalingGroupName)Result
All metrics will now have these dimensions:
InstanceId- EC2 instance IDAutoScalingGroupName- ASG name (if applicable)environment- Puppet environment (development/sandbox/production)Test plan
environmentdimensionInstanceIddimension