I setup Alert Monitoring for pubsub subscription like below:
I was expecting this to fire every 2 minutes, since the condition is met throughout.
But I got the notification only one time. I also tried with duration
1 minute. Still no luck.
What am I doing wrong here?
Or my understanding of these terms may be wrong?
What I want is: For every 2 minutes, when count of un-acked message count is > x, trigger an alert.
Note: I just masked the filter
field here, which is a subscription_id
.
Your current monitoring set up is working as intended since you only have a single time series and a single condition. As per alert notification docs:
You can only receive multiple notifications if any of the following are true:
All conditions are met:
When all conditions are met, then for each time series that results in a condition being met, the policy sends a notification and creates an incident. For example, if you have a policy with two conditions and each condition is monitoring one time series, then when the policy is triggered, you receive two notifications and you see two incidents.
Any condition is met:
The policy sends a notification each time a new combination of conditions is met. For example, assume that ConditionA is met, that an incident opens, and that a notification is sent. If the incident is still open when a subsequent measurement meets both ConditionA and ConditionB, then another notification is sent.
If you create the policy by using the Google Cloud Console, then the default behavior is to send a notification when the condition is met.
Lastly the purpose of "Period" is to just increase the data points in the chart and is not related to triggering a notification multiple times until it is below the threshold. Thus it is not possible send continuous notifications until the monitored data is below the threshold.