Cloud Run and Cloud Monitoring alert scoping across traffic-split revisions
0 reputation · 14 Feb 2021, 16:13 UTC
Goal: configure a Cloud Monitoring alert policy for a Cloud Run service that evaluates request latency or error rate while traffic is split across multiple revisions, without generating a separate alert for every revision or firing during scale-to-zero gaps.
Cloud Run emits request count, latency, and container utilization to Cloud Monitoring. Alert conditions can be scoped to a service, revision, or location, but a policy bound to one revision may not automatically cover newly deployed revisions unless the filter aggregates at the service level. Scale-to-zero can produce missing metric intervals, so absence-of-data handling must be decided before enabling notifications. Behavior may differ between fully managed Cloud Run and Cloud Run for Anthos.
- Should the condition use service-level aggregation so one policy covers all active revisions under a traffic split?
- How should missing data be treated during scale-to-zero to prevent false-positive absence-of-data alerts?
- Does the alert continue to evaluate correctly after a new revision is deployed and begins receiving traffic?