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.
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.
You can create alerting policies in Stackdriver Monitoring for each of the APIs and each of the metrics. To create and manage the alerting policies with the Stackdriver Monitoring you can use this link. You can define the metrics which you want to have alert for. This documentation shows the metrics lists for GCP. You can also create custom metrics using this link.