AWS re:Postを使用することにより、以下に同意したことになります AWS re:Post 利用規約

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?

質問済み 7ヶ月前264ビュー
1回答
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.

エキスパート
回答済み 7ヶ月前
profile picture
エキスパート
レビュー済み 6ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ