gpt4 book ai didi

amazon-web-services - 计算 CW 度量数学中的当前时间戳

转载 作者:行者123 更新时间:2023-12-03 21:20:05 25 4
gpt4 key购买 nike

我有一个用例可以在 SLA 未命中时发出警报。我的应用程序在 startTime (M1) 和 endTime (M2) 上发出指标。如果我的工作完成,我将能够通过执行 (M2-M1) 之类的度量数学并对此发出警报来了解 SLA 未命中。

但是如果我的工作卡住了,我仍然希望通过计算(currentTime-M1)(可能是按计划进行)得到提醒。这可以通过 AWS CloudWatch 实现吗?也欢迎非基于 AWS 的方法和解决方案!!

最佳答案

也许您可以创建一个 CloudWatch 洞察查询,如下所示:

fields ispresent(execution_arn) as isRes
| filter isRes
| filter type in ["ExecutionStarted", "ExecutionSucceeded", "ExecutionFailed", "ExecutionAborted", "ExecutionTimedOut"]
| stats latest(type) as status,
earliest (event_timestamp) as starttime,
latest (event_timestamp) as endtime,
endtime - starttime as duration by execution_arn
| sort duration desc
您必须为状态机启用 CW 日志:
https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html

关于amazon-web-services - 计算 CW 度量数学中的当前时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52093113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com