GCloudCLI icon
If icon
SlackIncomingWebhook icon
Schedule icon

Google Cloud Run Container Instance Autoscaling Ceiling Sentinel

Monitors Google Cloud Run instance counts against configured maxScale ceilings to detect autoscaling exhaustion.

Categories
CloudInfrastructure

How it works

This workflow executes gcloud monitoring timeseries list to inspect run.googleapis.com/container/instance_count for the specified Cloud Run service. When incoming request concurrency surges beyond capacity and active containers reach the configured maxScale setting, Cloud Run cannot spawn additional container instances. Additional requests queue up until concurrency limits exceed, throwing HTTP 429 or 503 errors. Slack is notified when instances approach 90% of the ceiling.

What you get

  • Immediate detection of Cloud Run autoscaling ceiling exhaustion.
  • Prevents customer request drops and latency degradation under sudden traffic spikes.
  • Clear visibility into peak active container counts over 15-minute intervals.

Who it's for

  • SREs and DevOps Engineers maintaining serverless web services and APIs.
  • Cloud Infrastructure Architects setting autoscaling policies on Google Cloud.

Why orchestrate this with Kestra

  • Native Cloud Run Telemetry: Tracks live container instance counts without sidecars.
  • Continuous Health Auditing: Run scheduled 15-minute verification across critical services.
  • Automated Scale Adjustments: Chain directly into gcloud run services update --max-instances workflows.

Prerequisites

  • Google Cloud Run service deployed with Cloud Monitoring enabled.
  • Secrets GCP_SERVICE_ACCOUNT and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import the blueprint into Kestra.
  2. Configure project ID, service name, and maxScale ceiling.
  3. Run the flow to audit container instance autoscaling.

How to extend

  • Automatically increase maxScale via gcloud command upon persistent traffic growth.
  • Monitor run.googleapis.com/request_latencies alongside instance counts.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.