Can I use Cloudwatch Metrics Insights to provide information about missing data in the included metrics?

0

I have systems that push a custom metric to CloudWatch metrics every 5 minutes. The metric values can be 1 (healthy), 0 (unhealthy), or missing (unhealthy - occurs if the system has crashed or gone off the network and can't report metrics). I'm looking to create a Metric Insights query and from there an Alarm that will alert me if any of these systems are unhealthy. I'm using this query:

SELECT MIN(Status) FROM SCHEMA("MyNamespace", MyDimension)

When I setup the Alarm, I selected "Treat Missing Data as Bad" which would work if I only had a single metric. But with multiple metrics it appears that if I have any systems healthy, the MIN(Status) will always return 1 and I do not detect that one of my systems has gone off the network.

Is there any way to use Metric Insights to return information about missing data for any of the underlying metrics in the query?

bruce
asked 9 days ago103 views
1 Answer
5

Hi Bruce, look at my solution it will be helpful for your query.

It sounds like you need a way to detect missing data for any of the underlying metrics in your query. But Metric Insights doesn't directly support querying for missing data across multiple metrics in the same way as treating missing data as bad for individual metrics.

However, you can still achieve this by modifying your approach slightly. Instead of using MIN(Status), you can use the IF function to check if any of the systems are unhealthy or have missing data.

Here's how you can modify your query:

SELECT IF(COUNT(Status) = COUNT(*), 1, 0) AS Overall_Status FROM SCHEMA("MyNamespace", MyDimension)

This query will return 1 if all systems are healthy (meaning the count of reported statuses is equal to the count of systems), and 0 otherwise.

Then, when setting up the alarm, you can treat missing data as bad. This will ensure that if any system has missing data, the overall status will be considered as unhealthy, triggering the alarm.

answered 9 days 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