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"
]
}
}
}
}