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

Keptn Lifecycle Pre-Deployment Evaluation Timeout Sentinel

Audits Keptn lifecycle telemetry to detect pre-deployment evaluation timeouts, analysis task failures, and rollout blocking stalls.

Categories
CloudInfrastructure

Automates continuous health and release gating surveillance for Keptn cloud-native lifecycle evaluation toolkits.

How it works

  1. A schedule trigger executes the Keptn lifecycle audit workflow every 15 minutes.
  2. The Python task queries the Keptn lifecycle operator metrics endpoint on port 9999.
  3. The script extracts pre-deployment evaluation timeouts, SLI analysis durations, and task failure counts.
  4. An evaluation gate determines whether evaluation timeouts, duration limits, or task failures breach bounds.
  5. When release verification stalls are detected, a high-priority Slack alert is dispatched to the Release Engineering team.
  6. When SLI evaluations pass cleanly and deployments proceed without delay, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for deployment governance and release verification compliance records.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Keptn Metrics]
    ScanMetrics --> EvalBreach{Timeouts > 2 OR Duration > 300s?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Release Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Keptn State]
    SlackAlert --> EmitManifest[Debug Return: Release Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes Keptn lifecycle operator Prometheus metrics endpoints using Docker container runners.
  • Decision Gate: Evaluates whether pre-deployment evaluation timeouts or SLI analysis durations exceed limits.
  • Notification Task: Dispatches structured Slack alerts with application identifier and duration metrics.
  • Audit Manifest: Emits JSON execution payloads containing release gating health and timestamps.

Key capabilities

  • Continuous surveillance of KeptnApp and KeptnEvaluationDefinition custom resource evaluation lifecycles.
  • Early warning detection for slow Prometheus or Datadog metric queries causing evaluation timeouts.
  • Automated tracking of pre-deployment analysis failures preventing automated progressive rollouts.
  • Zero host dependency execution via isolated containerized Python runners.

What you get

  • Real-time visibility into continuous delivery gating pipeline throughput and SLI evaluation performance.
  • Proactive alerts preventing blocked production deployments caused by unresponsive telemetry providers.
  • Standardized audit manifests containing exact timeout metrics and evaluation execution timestamps.
  • Zero-overhead deployment compatible with GitOps workflows driven by ArgoCD and Flux.

Who it's for

  • Release engineers managing progressive delivery and automated SLO verification in Kubernetes.
  • Platform SREs enforcing pre-deployment and post-deployment quality gates across development teams.
  • DevOps architects building automated canary evaluation and automated rollback pipelines.
  • Compliance officers auditing automated testing results and deployment approvals.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages release verification surveillance as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical evaluation metrics in searchable Kestra execution logs.

Use cases

  • Provider Outage Mitigation: Detects when third-party metrics providers fail during deployment evaluation phases.
  • Rollout Bottleneck Analysis: Identifies slow KeptnTask executions delaying time-to-production for developers.
  • SLI Quality Assurance: Verifies that evaluation queries complete reliably without triggering false rejections.

Inputs

Name Type Default Description
keptn_metrics_url STRING http://keptn-lifecycle-operator.keptn-lifecycle-toolkit-system.svc.cluster.local:9999 Internal HTTP URL exposing Prometheus metrics for Keptn.
application_name STRING production-checkout-service Name of the KeptnApp workload under evaluation surveillance.
max_evaluation_timeouts_threshold INT 2 Maximum allowable evaluation timeouts before raising an alert.
max_evaluation_duration_seconds INT 300 Maximum acceptable evaluation duration in seconds.
alert_on_task_failure BOOL true Toggle whether evaluation task failure triggers an alert.

Expected outputs

  • {{ outputs.scan_keptn_telemetry.vars.evaluation_timeouts_count }}: Count of pre-deployment evaluation timeouts.
  • {{ outputs.scan_keptn_telemetry.vars.evaluation_duration_seconds }}: Maximum observed evaluation execution duration.
  • {{ outputs.scan_keptn_telemetry.vars.task_failures_count }}: Count of failed Keptn evaluation tasks.
  • {{ outputs.scan_keptn_telemetry.vars.is_alerting }}: Boolean flag indicating if release SLA is breached.
  • {{ outputs.scan_keptn_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the release audit run.

Prerequisites

  • Keptn Lifecycle Toolkit 0.8+ deployed with Prometheus metrics enabled on port 9999.
  • Network connectivity from the Kestra worker to the Keptn operator metrics service.
  • Configured Slack incoming webhook URL with permissions to post in release alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing release alerts to the Release Engineering Slack channel.

Quick start

  1. Verify that Keptn lifecycle operator exposes Prometheus metrics on HTTP port 9999.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your application identifier in application_name.
  4. Run a manual flow execution via the Kestra UI to validate metric ingestion.
  5. Enable the periodic_keptn_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • Provider Query Timeouts: KeptnEvaluationProvider queries to Prometheus can fail if PromQL range is too broad.
  • Service Account Permissions: Ensure Keptn operator service accounts have RBAC read access to target metrics APIs.
  • App Version Annotations: Missing or malformed app.kubernetes.io/version labels prevent KeptnApp tracking.
  • Evaluation Retry Limits: If evaluations retry indefinitely, configure explicit evaluationInterval and retry bounds.

How to extend

  • Automated Gate Override: Trigger an automated Keptn evaluation force-pass annotation during critical hotfixes.
  • PagerDuty Escalation: Escalate to on-call release leads if deployment pipelines remain stalled for over 30 minutes.
  • Multi-Environment Tracking: Expand metrics scraping across staging, canary, and production namespaces simultaneously.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.