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
gefragt vor 3 Jahren1148 Aufrufe
1 Antwort
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
beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen