Is there a way to setup Stackdriver to receive an alert when ANY of my Google APIs usage have reached its limit?
I used to manually check at https://console.cloud.google.com/iam-admin/quotas but I can't figure out how to be automatically alerted.
It looks like you can do at least some through Stackdriver. Open Stackdriver Monitoring and use theMetrics Explorer. Search for "Consumer Quota" as the resource and choose your metric. It'll display all the APIs enabled. Locate your API and add a filter.
For example, I wanted to monitor Vision API landmark detection calls so my filter was quota_metric and the value was "vision.googleapis.com/landmark_detection_requests". Once you know the filter you need, you should be able to create an alert.
See how you get on.
There's this Github repo that shows how you can integrate GCE Quotas into Stackdriver.
It basically gets the amount of CPUs available per region and gives you the % that is in use, storing these values into Stackdriver as custom metrics. Then, you can configure alerts in Stackdriver to notify you when you pass a threshold.
The script may be a guide that can be used to integrate additional metrics.
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