Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Spinnaker Pipeline Execution Stall and Orca Backlog Sentinel

Scrapes Spinnaker Prometheus metrics to track Orca task queue depth, stalled deployment stages, and Clouddriver errors with Slack alerting.

Categories
CloudInfrastructure

Production-grade continuous delivery reliability watchdog that continuously monitors Spinnaker multi-cloud deployment platforms. It tracks Orca orchestration execution queue depths, detects stalled deployment pipeline stages waiting indefinitely on cloud provider resources, monitors Clouddriver cloud provider API failure surges, and dispatches structured Slack alerts before enterprise deployment freezes block production releases.

How it works

  1. A recurring schedule trigger wakes the flow every 15 minutes to initiate Spinnaker delivery surveillance.
  2. A containerized Python script polls the Spinnaker monitoring daemon Prometheus metrics endpoint.
  3. The script extracts Orca execution task queue depths (orca_queue_depth) and pending message backlogs in Redis.
  4. The script monitors stalled pipeline execution stages and Clouddriver cloud provider HTTP 500 error rates.
  5. A decision gate evaluates whether task queue backlogs or stalled stages breach deployment SLA margins.
  6. When release stalls occur, high-priority notifications dispatch to Release Engineering channels with runbooks.
  7. A structured audit manifest is emitted for enterprise compliance records and CD pipeline telemetry archives.

Architecture diagram

flowchart TD
    A[Schedule Trigger: Every 15 Mins] --> B[scan_spinnaker_queue_metrics]
    B --> C{evaluate_spinnaker_threshold}
    C -- Alert Triggered --> D[notify_slack_platform_team]
    C -- Nominal State --> E[log_nominal_spinnaker_state]
    D --> F[emit_audit_manifest]
    E --> F[emit_audit_manifest]

Architecture components

  • Trigger (periodic_spinnaker_audit): Recurring cron schedule executing every 15 minutes for proactive CD surveillance.
  • Scraper Task (scan_spinnaker_queue_metrics): Docker-isolated Python script polling Spinnaker metrics with error handling.
  • Decision Gate (evaluate_spinnaker_threshold): Evaluates Orca queue depth and stalled stages against user thresholds.
  • Notification Task (notify_slack_platform_team): Sends rich Slack alert with queue counts, stalled stages, and runbooks.
  • Compliance Manifest (emit_audit_manifest): Emits structured JSON summary for delivery audit archives.

Key capabilities

  • Continuous surveillance of Spinnaker Orca task orchestration queue depth and worker capacity.
  • Early warning when cloud provider rate limits stall canary analysis or blue-green deployments.
  • Detection of Clouddriver Kubernetes API timeouts before deployment pipelines timeout completely.
  • Standardized Slack alerting with operational runbook instructions for release engineers.

What you get

  • Real-time visibility into Spinnaker delivery platform throughput and pipeline execution health.
  • Prevention of silent deployment deadlocks caused by zombie tasks in underlying Redis queues.
  • Automated Slack incident notifications with execution queue metrics and remediation advice.
  • Clean compliance manifests recording CD platform reliability for change management audit trails.

Who it's for

  • Release Engineers maintaining enterprise Spinnaker multi-cloud deployment platforms.
  • Platform Engineering Teams operating automated progressive delivery and canary pipelines.
  • Site Reliability Engineers safeguarding zero-downtime microservice deployments across clouds.
  • DevOps Teams operating high-frequency continuous delivery pipelines on Kubernetes and AWS.

Why orchestrate this with Kestra

  • Decoupled Architecture: Scrapes metrics externally without requiring root access to Spinnaker microservices.
  • Deterministic Scheduling: Native cron scheduling ensures consistent surveillance without cron daemon drift.
  • Isolated Execution: Runs Python scrapers inside isolated Docker containers with pre-installed libraries.
  • Enterprise Auditability: Generates structured execution histories and JSON manifests for regulatory reporting.

Use cases

  • Kubernetes Rate Limiting: Catch when Clouddriver exhausts Kubernetes API server client request quotas.
  • Zombie Execution Purging: Detect pipelines that remain stuck in running state due to disconnected worker threads.
  • Redis Queue Saturation: Identify when Redis backing Orca exhausts memory and delays task dispatch.
  • Canary Stage Timeout Surveillance: Monitor Kayenta canary judge stages waiting on telemetry providers.

Inputs

Name Type Default Description
spinnaker_metrics_url STRING http://spinnaker-monitoring.spinnaker.svc.cluster.local:8008 Base HTTP URL exposing Spinnaker Prometheus metrics.
target_spinnaker_application STRING core-payment-gateway Target Spinnaker application identifier under active surveillance.
max_backlog_tasks_threshold INT 50 Maximum allowable Orca backlog tasks before alerting.
lookback_minutes INT 15 Lookback evaluation window in minutes for pipeline telemetry.
alert_on_spinnaker_failures BOOL true Toggle Slack alert dispatch upon detecting execution stalls or backlogs.

Expected outputs

  • {{ outputs.scan_spinnaker_queue_metrics.vars.orca_queue_depth }}: Current depth of pending tasks in Orca execution queue.
  • {{ outputs.scan_spinnaker_queue_metrics.vars.stalled_stages_count }}: Count of pipeline stages stalled beyond execution threshold.
  • {{ outputs.scan_spinnaker_queue_metrics.vars.clouddriver_errors_count }}: Cumulative count of Clouddriver cloud provider errors.
  • {{ outputs.scan_spinnaker_queue_metrics.vars.active_pipelines_count }}: Total number of pipelines actively executing across applications.
  • {{ outputs.scan_spinnaker_queue_metrics.vars.is_alerting }}: Boolean flag indicating whether failure thresholds were breached.
  • {{ outputs.emit_audit_manifest.value }}: Structured JSON audit manifest emitted for compliance archives.

Prerequisites

  • Spinnaker cluster deployed with spinnaker-monitoring daemon active and Prometheus port 8008 open.
  • Metrics port reachable from the Kestra worker execution environment.
  • Docker daemon running on the Kestra host to execute containerized Python tasks.

Secrets

  • SLACK_WEBHOOK_URL: Incoming webhook URL for the target Release Engineering Slack alerting channel.

Quick start

  1. Ensure Spinnaker monitoring daemon exposes Prometheus metrics on port 8008.
  2. Configure the SLACK_WEBHOOK_URL secret in your Kestra namespace settings.
  3. Specify your Spinnaker application name in target_spinnaker_application.
  4. Execute a manual test run via the Kestra UI to verify metric ingestion.
  5. Enable the periodic_spinnaker_audit trigger to establish automated continuous surveillance.

Common pitfalls and troubleshooting

  • Redis Queue Eviction: If Redis runs out of memory, task state is dropped and pipelines hang indefinitely.
  • Cloud Provider API Throttling: AWS or GCP throttling causes Clouddriver caching agent threads to back up.
  • Orca Threadpool Exhaustion: High concurrent pipeline triggers saturate Orca worker threadpools; scale Orca pods.
  • Echo Event Dispatch Latency: Delays in Echo event bus prevent pipeline trigger notifications reaching Orca.

How to extend

  • Automated Zombie Pipeline Cancellation: Trigger a REST API call to cancel pipelines running longer than 4 hours.
  • Orca Horizontal Autoscaling: Chain a task to scale Orca deployment replicas when queue depth exceeds 100.
  • PagerDuty Escalation: Escalate to on-call release engineers if stalled stages exceed 10 across the cluster.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.