Cloudwatch 'number' widget that displays number of active alarms

0

Hi , I am trying to configure a simple cloudwatch 'number' widget that displays the total number of alarms currently in 'in-alarm' status ...and likewise another one that displays the total number of alarms in 'ok' status. (i will colour the widgets red and green accordingly) ...our OPs team need this very simple view as they are running out of screen real estate to display much else

My question is, how can i get the widget to display this count of alarms? it seems widgets can only be based on metrics ...would i need to create a custom metric that somehow counts the alarms based on a query? (such as alarm status or a string match in the alarm name etc) ....is this even possible?...or would i have to have some type of lambda to do this?

Any guidance would be greatly appreciated thanks

asked 2 years ago937 views
2 Answers
1

Hi, emitting a metric is one possibility. You would need though to create this metric in a custom way, e.g. call a lambda on a regular schedule (using eventbridge) to count your alarms and emit the number to a metric.

You can also create a custom widget on your dashboard? You can write the same lambda that counts your alarms, the difference is the lambda would output the number in HTML to feed the custom widget, and you don't need to call your lambda on a schedule. As an optimization you can save the count from the lambda to not run the query every time a dashboard is displayed or refreshed but only at whatever refresh rate you want.

profile pictureAWS
Jsc
answered 2 years ago
0

Thanks ...I found this really good article to help with the above https://medium.com/@anatoliydadashev/aws-cloudwatch-alarms-count-in-grafana-53932f5bc901

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions