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
demandé il y a 3 ans1148 vues
1 réponse
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
répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions