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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠