Schedule icon
Request icon
Log icon
Switch icon
SlackIncomingWebhook icon
OutputValues icon

Woodpecker CI Server Health, Worker Queue, and Pipeline Sentinel

Audit Woodpecker CI server liveness, monitor agent runner queue readiness, validate repository pipeline engines, and alert Slack on incidents via Kestra.

Categories
Infrastructure

How it works

  1. Automated Heartbeat Trigger: A scheduled cron trigger executes every 15 minutes to run an automated health audit across the Woodpecker CI platform, with on-demand manual or webhook execution supported.
  2. Multi-Stage Service Probes:
    • probe_server_health: Queries Woodpecker's /healthz endpoint to inspect PostgreSQL/SQLite database connection pool health and server heartbeat.
    • probe_version_and_liveness: Queries /version to verify API gateway responsiveness and version consistency.
    • probe_server_info: Queries /api/info to check cluster configuration, worker queue state, and agent registration.
    • probe_repository_pipelines: Queries /api/repos to confirm pipeline engine accessibility and Git repository metadata sync.
  3. Pebble Health Classification: Evaluates response status codes, sub-service availability, and response latencies to classify cluster state into OPERATIONAL, DEGRADED, or CRITICAL.
  4. Switch Routing & Safe Remediation:
    • CRITICAL: Emits urgent error diagnostics and immediately dispatches a formatted incident alert to Slack containing status codes and execution context.
    • DEGRADED: Emits a warning log for non-critical sub-service delays and dispatches a Slack warning notification if warning alerts are enabled.
    • OPERATIONAL: Emits a health verification log confirming all CI endpoints and queues are healthy.
  5. Structured Telemetry Output: Emits structured outputs via io.kestra.plugin.core.output.OutputValues for downstream monitoring dashboards, APM systems, or data lake ingestion.
  6. Error Incident Fallback: Dedicated errors task catches network connection refused errors or worker timeout exceptions, alerting engineering teams instantly.

What you get

  • Continuous validation of your self-hosted Woodpecker CI server and container execution engine.
  • Early warning detection for hung agent queues, runner disconnects, or database lockups before development teams encounter stuck CI/CD builds.
  • Automated multi-channel Slack incident alerting with formatted block layouts and execution context.
  • Comprehensive telemetry audit log with timestamped metrics for long-term health tracking.
  • Zero vendor lock-in, fully testable against standard open-source Woodpecker Docker containers.

Who it's for

  • DevOps & Platform Engineers: Ensuring continuous availability of developer build pipelines and continuous integration runners.
  • Site Reliability Engineers (SREs): Automating proactive drift detection and platform heartbeat monitoring without external SaaS dependencies.
  • Engineering Managers: Maintaining high SLA uptime for internal CI/CD build infrastructure and release pipelines.

Why orchestrate this with Kestra

  • Declarative YAML Workflows: Define your infrastructure monitoring alongside your CI/CD pipelines in version-controlled Git repositories.
  • Built-in Resilience & Retries: Automatically handle transient network jitter with configurable retry policies on individual probe tasks.
  • Stateful Flow Control: Seamlessly branch between operational logs and multi-channel incident dispatches without writing fragile shell scripts.
  • Unified Telemetry & Auditability: Every execution retains full output history, timing metrics, and response payloads for forensic analysis.

Prerequisites

  • An operational Woodpecker CI server (accessible via HTTP or HTTPS).
  • Network connectivity from the Kestra worker to the Woodpecker server.
  • (Optional) An incoming Slack Webhook URL for incident notifications.
  • (Optional) A Woodpecker CI personal access token if your instance restricts API access.

Secrets

  • SLACK_WEBHOOK_URL: (Optional) Slack Incoming Webhook URL to dispatch alerts on degraded or critical status.
  • WOODPECKER_API_TOKEN: (Optional) Personal access token for authenticated API requests if the Woodpecker server requires authorization.

Quick start

  1. Start a local Woodpecker CI server container for testing:
    docker run -d --name woodpecker-server -p 8000:8000 -e WOODPECKER_OPEN=true woodpeckerci/woodpecker-server:latest
    
  2. Add the SLACK_WEBHOOK_URL secret in your Kestra namespace or pass it as an execution input.
  3. Import this flow into your Kestra instance.
  4. Execute the flow manually with woodpecker_url: http://localhost:8000 to verify connectivity.
  5. Enable the schedule trigger for continuous 15-minute background monitoring.

How to extend

  • Agent Runner Auto-Recovery: Add a container task to restart unhealthy Woodpecker agent containers via Docker or Kubernetes API when queue backlog spikes.
  • Synthetic Canary Pipeline Run: Add a task that triggers a synthetic canary build via /api/repos/{repo_id}/builds to test end-to-end container execution.
  • Queue Latency Metrics Export: Push probe latency and active build metrics to a Prometheus Pushgateway or OpenTelemetry collector for unified Grafana dashboards.
  • PagerDuty Escalation: Integrate on-call incident dispatching if CRITICAL state persists across multiple consecutive executions.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.