Is it possible for GCP's "Metrics explorer" to aggregate within a fixed time range instead of the rolling window?

Viewed 578

Is it possible for GCP's "Metrics explorer" to aggregate within a fixed time range instead of the "rolling window"?

I want to monitor the API consumption to make sure it does not reach the Quota. Then, when the limit is approached, I want to set up an alert policy in order to take measures such as applying for relaxation of the limit or reducing usage.

Let's say I have the following data points

datetime API request count
August 1, 10:00 1
August 1, 15:00 1
August 1, 20:00 1
August 2, 01:00 1
August 2, 06:00 1

Since the API Quota is reset at 0:00 every day, I want to monitor the sum of consumption from 0:00 on one day to 0:00 on the next day. For example, I want to observe "3" as the usage on August 1, and "2" as the usage on August 2.

However, the period of aggregation in GCP's Metrics explorer seems to be "Rolling window" only. In that case, for example, "4" at 02:00 on August 2 and 5" at 09:00 on August 2 will be observed.

0 Answers
Related