I see that AWS RDS provides a FreeStorageSpace
metric for monitoring disk usage. Now I am trying to create a generic pre-emptive alert for all my R
If you enable Enhanced Monitoring, then the RDSOSMetrics log group in Cloudwatch Logs will have detailed JSON log messages which include filesystem statistics. I ended up creating a Cloudwatch Logs metric filter to parse out the usedPercent
value from the fileSys
attribute for the root filesystem. At least for Postgresql, these detailed logs include both /
and /rdsdbdata
filesystems; the latter is the one that is of interest in terms of storage space.
You can create a metric filter of the form {$.instanceID = "My_DB_Instance_Name" && $.fileSys[0].mountPoint = "/rdsdbdata"}
and a corresponding metric value $.fileSys[0].usedPercent
to get the used storage percentage for a given instance. This would then be available as a Log Metric that you could use to trigger an alarm. You probably need to create another metric replacing filesystem[0]
with filesystem[1]
since ordering is unknown for that array. You'd probably want to create these for each RDS instance you have so you know which one is running out of space, but you question seems to indicate you don't want a per-instance alarm.
I suppose you could exclude the $.instanceID
from the metric filter and just get all values written to a single metric. When it reached a threshold and triggered an alarm, you'd need to start checking to see which instance is responsible.