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

LitmusChaos Experiment Verdict and Probe Failure Sentinel

Audits LitmusChaos telemetry to detect failed ChaosEngine verdicts, resilience probe assertion errors, and unrecovered target pods.

Categories
CloudInfrastructure

Automates continuous health and experiment result validation for LitmusChaos cloud-native resilience testing frameworks.

How it works

  1. A schedule trigger executes the LitmusChaos audit workflow every 15 minutes.
  2. The Python task queries the LitmusChaos operator metrics service endpoint on port 8080.
  3. The script extracts ChaosEngine experiment verdict totals, probe assertion failure ratios, and unrecovered pod counts.
  4. An evaluation gate determines whether failed experiments, probe errors, or unrecovered pods breach operational bounds.
  5. When experiment failures are detected, a high-priority Slack alert is dispatched to the Resilience Engineering team.
  6. When chaos tests complete with passing verdicts and healthy targets, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for resilience governance and chaos engineering compliance records.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Litmus Metrics]
    ScanMetrics --> EvalBreach{Failed Experiments > 2 OR Unrecovered Pods?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Resilience Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Litmus State]
    SlackAlert --> EmitManifest[Debug Return: Chaos Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes LitmusChaos Prometheus metrics endpoints using Docker container runners.
  • Decision Gate: Evaluates whether failed ChaosEngine verdicts or probe failure percentages exceed limits.
  • Notification Task: Dispatches structured Slack alerts with chaos namespace and unrecovered pod counts.
  • Audit Manifest: Emits JSON execution payloads containing chaos experiment health and timestamps.

Key capabilities

  • Continuous surveillance of ChaosEngine experiment results across staging and production clusters.
  • Real-time tracking of declarative probe assertions including HTTP, cmd, and PromQL probes.
  • Immediate detection of unrecovered target application pods following fault injection phases.
  • Zero host dependency execution via isolated containerized Python runners.

What you get

  • Real-time visibility into cloud-native resilience testing results and blast-radius containment.
  • Proactive alerts preventing unintended production degradation caused by stalled chaos experiments.
  • Standardized audit manifests containing exact experiment verdict counts and execution timestamps.
  • Zero-overhead deployment compatible with GitOps-driven continuous chaos workflows.

Who it's for

  • Resilience and Chaos SREs validating system fault tolerance and graceful degradation mechanisms.
  • Platform reliability engineers testing Kubernetes service recovery and pod failover automation.
  • Quality assurance teams running automated game days and continuous resilience verifications.
  • Cloud infrastructure architects enforcing resilience SLAs across distributed microservices.

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 chaos engineering surveillance as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical chaos testing telemetry in searchable Kestra execution logs.

Use cases

  • Automated Game Day Auditing: Validates that scheduled chaos experiments complete within expected bounds.
  • Blast Radius Containment: Alerts engineers immediately if chaos injection leaves pods in CrashLoopBackOff.
  • Continuous Resilience Gating: Verifies microservice SLO resilience before promoting release candidates.

Inputs

Name Type Default Description
litmus_metrics_url STRING http://litmus-chaos-operator.litmus.svc.cluster.local:8080 Internal HTTP URL exposing Prometheus metrics for Litmus.
chaos_namespace STRING litmus Kubernetes namespace where ChaosEngine resources execute.
max_failed_experiments_threshold INT 2 Maximum allowable failed experiment verdicts before alerting.
max_probe_failure_rate_threshold FLOAT 5.0 Maximum acceptable probe failure percentage.
alert_on_target_unrecovered BOOL true Toggle whether unrecovered pods trigger an alert.

Expected outputs

  • {{ outputs.scan_litmus_telemetry.vars.failed_experiments_count }}: Count of failed ChaosEngine experiment verdicts.
  • {{ outputs.scan_litmus_telemetry.vars.probe_failure_rate_percent }}: Percentage of failed probe assertion evaluations.
  • {{ outputs.scan_litmus_telemetry.vars.unrecovered_pods_count }}: Count of target application pods failing recovery.
  • {{ outputs.scan_litmus_telemetry.vars.is_alerting }}: Boolean flag indicating if resilience SLA is breached.
  • {{ outputs.scan_litmus_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the chaos audit run.

Prerequisites

  • LitmusChaos 3.0+ deployed with Prometheus metrics exporter enabled on port 8080.
  • Network connectivity from the Kestra worker to the Litmus operator metrics service.
  • Configured Slack incoming webhook URL with permissions to post in resilience alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing chaos alerts to the Resilience Engineering Slack channel.

Quick start

  1. Verify that LitmusChaos operator exposes Prometheus metrics on HTTP port 8080.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your chaos execution namespace in chaos_namespace.
  4. Run a manual flow execution via the Kestra UI to validate metric ingestion.
  5. Enable the periodic_litmus_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • Stale ChaosEngine CRDs: Completed experiments may retain failed verdict status until manually deleted or pruned.
  • Probe Timeout Limits: HTTP or command probes with short timeouts may report false positive failures under load.
  • RBAC Permissions: Ensure Litmus runner service accounts have permissions to inspect target pod lifecycle events.
  • Node Resource Contention: CPU or memory stress tests may cause node-level kubelet evictions if unconstrained.

How to extend

  • Automated Chaos Abortion: Trigger a kubectl patch chaosengine command to immediately abort failing experiments.
  • PagerDuty Escalation: Escalate to on-call resilience leads if unrecovered target pods persist across 2 cycles.
  • Chaos Hub Ingestion: Fetch newly released experiment templates from the public ChaosHub repository.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.