Set GCP alert by monitoring sum of API request count/usage within one day?

Viewed 879

In GCP Monitoring and alerting, I was trying to add an alert policy of API request count in sum within one day. (maps-backend.googleapis.com)

My metrics setting images

As the above attached picture shows, I can see correct value and chart on my metrics. At any point my value is above 500, but the trigger of threshold 300 doesn't trigger at all. But when I set my threshold to 100, I got an alert email that told me the value was like one hundred something, which means my notification channel is working fine.

Here is my settings for my metrics and alert condition:

Resource type: Consumed API
Metric: Request count

Filter
credential_id: XXXXXX
credential_id: XXXXXX
service: maps-backend.googleapis.com

Aggregator: sum

In Advanced Aggregation
Aligner: sum
Alignment Period: 1 day

Configuration
Condition triggers if: Any time series violates
Condition: is above
Threshold: 300
For: most recent value

How to correctly monitor and alert API request count/usage in sum within one day?

1 Answers

As a workaround, it is possible to monitor and alert it by Consumer Quota, Quota limit, the service name, then summarize during the daily interval. This way it does what is needed.

Related