How do you monitor a Cloud Run service on GCP and alert on errors?
IntermediateScenarioCloud Monitoring, Incidents and Migrations
Answer
Situation read → Cloud Run exports request metrics to Cloud Monitoring automatically.
What I'd do →
- Use built-in metrics:
run.googleapis.com/request_count(byresponse_code_class),request_latencies,container/instance_count,container/cpu/utilizations. - Create an alerting policy on the 5xx ratio (in PromQL, which Cloud Monitoring supports):
sum(rate(run_googleapis_com:request_count{monitored_resource="cloud_run_revision",response_code_class="5xx"}[5m])) / sum(rate(run_googleapis_com:request_count{monitored_resource="cloud_run_revision"}[5m])) > 0.02 - Add an uptime check against the public URL from multiple regions.
- Define an SLO in Cloud Monitoring's service monitoring for burn-rate alerts.
- Use Cloud Trace via OTel for latency breakdown.
Why → Managed metrics plus uptime checks cover most serverless needs.
Interview tip → Mention that MQL is being phased out in favour of PromQL in Cloud Monitoring.
More on Cloud Monitoring, Incidents and Migrations
A new AWS workload uses EC2, an ALB and RDS, with only CloudWatch available. Which alarms do you create first?BeginnerThe CloudWatch bill jumped from $2k to $15k a month. How do you find and cut the cost?IntermediateYour company has 50 AWS accounts. How do you get one monitoring view?IntermediateYour team uses Prometheus and Grafana, but RDS, SQS and ALB metrics live only in CloudWatch. How do you unify?IntermediateHow do you monitor a fleet of AWS Lambda functions?BeginnerYour RDS PostgreSQL database gets slow every afternoon. What monitoring do you use to find out why?Beginner