问题描述
我正在尝试创建一个警报条件,如果不发生不频繁的事件(例如,每周执行一次cron作业),它将触发。
度量标准为log-based。通过使用对齐时间,我已经在较小的窗口上取得了成功,但是在对齐时间不能超过1天的情况下存在一个限制。
不支持超过86400秒的对齐时间。
(无法正常工作)我正在尝试的示例:
- conditionThreshold:
aggregations:
- alignmentPeriod: 604800s # 1 week NOT possible
perSeriesAligner: ALIGN_SUM
comparison: COMPARISON_LT
thresholdValue: 1.0
duration: 0s
filter: metric.type="logging.googleapis.com/user/my_infrequent_event_count"
trigger:
count: 1
displayName: Infrequent event did not occur
关于这怎么可能的任何想法?
解决方法
由于持续时间不能超过24小时,因此目前无法实现。 解决方法是,Cloud Monitoring metric export对于长期指标分析很有用。另请参阅this doc。
我发现了this public thread,这可能也会有所帮助。