GCloudCLI icon
If icon
SlackIncomingWebhook icon
Schedule icon

Google Cloud Pub/Sub Subscription Oldest Unacked Message Sentinel

Monitors Google Cloud Pub/Sub oldest_unacked_message_age to detect subscriber processing stalls and message backlog.

Categories
CloudData

How it works

This workflow executes gcloud monitoring timeseries list to evaluate pubsub.googleapis.com/subscription/oldest_unacked_message_age. In event-driven architectures, when subscriber applications crash, deadlock on external database calls, or encounter poison-pill messages, unacknowledged messages pile up in the subscription backlog. If messages remain unacked beyond the threshold, Slack is notified immediately before message retention deadlines expire.

What you get

  • Real-time detection of stalled Pub/Sub streaming consumer pipelines.
  • Prevents message drops caused by subscription message retention deadlines (default 7 days).
  • Precise metrics on oldest unacknowledged message age in seconds.

Who it's for

  • Streaming Data Engineers and SREs maintaining real-time event ingest architectures.
  • Backend Developers building microservices consuming from Google Cloud Pub/Sub.

Why orchestrate this with Kestra

  • Direct Cloud Monitoring Query: Extract subscription latency metrics without custom exporter agents.
  • Continuous Pipeline Assurance: Guarantee message processing SLAs across enterprise topics.
  • Self-Healing Integration: Automate subscriber pod scaling or dead-letter topic routing.

Prerequisites

  • Google Cloud Pub/Sub subscription with active event publishing.
  • Secrets GCP_SERVICE_ACCOUNT and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import the blueprint.
  2. Configure project ID and subscription name.
  3. Run the workflow to inspect message lag.

How to extend

  • Query num_undelivered_messages to monitor backlog depth alongside message age.
  • Automatically scale consumer GKE deployments upon severe lag spikes.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.