there are some metrics in GCP's Stackdriver like f.e. serviceruntime.googleapis.com/quota/exceeded
that appear when there is a problem and are absent (not 0) if there is no more problem.
The problem is I cannot set up alerting to auto-resolve, because when the problem is resolved data for this metric is absent.
How can I set up alerts to auto-resolve with these types of metrics?
Go to the Stackdriver Logging console on GCP and filter the auth logs for that particular instance. You can use the Advanced filter option for better filtration. The auth log title should be like this “session opened for user USERNAME”. After filtering the logs, create a metric from the filtered logs.
To learn how to set up a metric-based alerting policy, try the Quickstart for Compute Engine. You can also create log-based alerting policies, which notify you when a particular message appears in your logs. These policies are not based on metrics. This content does not apply to log-based alerting policies.
To be notified when metric data stops arriving, select Metric absence. To be notified based on the value of a metric, select Threshold. To specify how individual time series contribute to when a condition is met, select a value from the Alert trigger menu.
This post is part 2 in the Stackdriver Automation series. In part 1, I covered automating the management of Stackdriver Groups. In this post, I will walk through the steps that you can use to automate the management of Alerting Policies. Head over to part 1 for the background and prerequisites.
Unfortunately, there's no solution at the moment. Google Engineers are aware about this problem. You can join (use +1
mark), comment and follow the feature request at the Google Public Issue Tracker to be updated of any changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With