问题
I've set up an alerting policy in StackDriver on the "instance/uptime" metrics. To alert when it's less 1 for 1 minute.
Then I deleted the instance, and had no alerts.
Is it so because at the following time window the data isn't 0 rather none, so no alerts are sent?
回答1:
I reproduced your situation
If the instance is deleted, there's no alerts being generated, this is expected behavior since the resource (VM) doesn't exist anymore.
Uptime alerts are generated when only VM instances are up and running.
It seems you are trying to send alert when instances are deleted, if this is the case, this can be done with log-based metrics in Stackdriver Logging which can be used in Stackdriver Monitoring to generate alerts. The following links will assist in this regards Creating Counter Metrics and Logs-based metrics interface
来源:https://stackoverflow.com/questions/53690620/stackdriver-alert-when-theres-no-data