I'm trying to create an alert condition where if an infrequent event (e.g. cron job running once a week) does not occur, it will trigger.
The metric is log-based. I've had success with smaller windows by using the alignment period, but there is a limitation where the alignment period can not be longer than 1 day.
Alignment periods longer than 86400 seconds are not supported.
(Not working) sample of what I'm trying to do:
- 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
Any idea on how this is possible?
Currently this is not possible to accomplish as the duration can’t exceed from 24h. As a workaround, you might find useful Cloud Monitoring metric export for long-term metrics analysis. Please also refer to this doc.
I found this public thread, which might be helpful too.