Search code examples
amazon-web-servicesamazon-rdsamazon-cloudwatchamazon-cloudwatch-metrics

How to get information on which resource actually breached cloudwatch alarm


I have setup a cloudwatch alarm for RDS "By Database Engine" for postgres for "FreeableMemory" metric and assign an alarm when the Free Memory is less than 1GB. When an alarm is raised, is it possible to get the information on which specific RDS resource/instance actually breached the alarm?.

I could specify "Per Database" metric but then I have to setup one for every instance of db I got. Is it possible to set alart for broader category like "By Database Engine" and when alarm is breached, just look at the event payload and get list of resources that actually breached the alarm?


Solution

  • I don't think you could include that information in your Database Engine level alarm. However, once the alarm is raised, you can easily see which DB has that metric crossed your threshold. Just go to CloudWatch metrics and select FreeableMemory metric and then select all databases from the list. In the diagram you can see any instances above the threshold.

    As you mentioned, you could also create an alarm for each DB instance. That may be a tedious task if you do it manually, but you can easily automate it using a script which iterates through the list of your DB instances.