Duplicate disk_used_percent metrics

0

I have CloudWatch Agent installed on Ubuntu instances, set to monitor disk_used_percent for two paths ("/", and "/mnt/data")

These are Nitro instances, so the nvme device names can change after reboot (e.g. nvme0n1p1 can become nvme1n1p1). To deal with the nvme device name changes, I use "aggregation_dimensions" leaving out the "device" dimension in the CloudWatch Agent config. This works, but I get duplicate metrics being sent to CloudWatch.

In the CloudWatch console, I see disk_used_percent metrics for both paths listed under
CWAgent > InstanceId, fstype, path

But I also see disk_used_percent metrics for both paths listed under
CWAgent > InstanceId, device, fstype, path

How can I deal with the changing device name, but not send duplicate metrics? Thanks!

Here is my CloudWatch Agent config:

{
  "metrics": {
    "append_dimensions": {                      
      "InstanceId": "${!aws:InstanceId}"
    },
    "aggregation_dimensions" : [["InstanceId","fstype","path"]],
    "metrics_collected": {
      "disk": {
        "measurement": [
          "disk_used_percent"
        ],                
        "resources": [
          "/",
          "/mnt/data"
        ]
      }
    }
  }
}
a-ron
asked 3 years ago1121 views
1 Answer
0

Found the solution. Specify the drop_device option for the "disk" portion of the CloudWatch Agent config, and then you don't need to bother with aggregation_dimensions

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html

"drop_device – Setting this to true causes Device to not be included as a dimension for disk metrics."

a-ron
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions