Trigger icon
AwsCLI icon
Loop icon
SlackIncomingWebhook icon

CloudWatch Metric Breach Auto-Triage

When a CloudWatch metric breaches, auto-collect metric context and run diagnostics, then post a triage bundle to Slack. Built for on-call engineers.

Categories
Infrastructure

A "CPU > 80%" alert with zero context is where incidents go to waste time. The on-call engineer opens the alert, then spends twenty minutes clicking through CloudWatch, logs, and the console to figure out what's actually wrong. This blueprint does that triage automatically the moment the metric fires.

How it works

  1. A CloudWatch metric trigger watches your namespace/metric and fires on breach.
  2. The flow pulls the metric datapoints surrounding the breach window for immediate context.
  3. A ForEach loop runs your configured read-only diagnostic commands (instance state, log tails, recent deployments) via the AWS CLI.
  4. A Slack webhook posts the whole triage bundle, metric context, diagnostics output, and your runbook link, in one message.

What you get

  • Incident alerts that arrive with evidence, not just a threshold name.
  • Consistent triage: every breach runs the same diagnostics, no matter who is on call.
  • Read-only by design, the flow never mutates infrastructure, only observes.
  • One-click jump from Slack straight to the relevant runbook.

Who it's for

On-call engineers, SREs, and platform teams who want CloudWatch alarms to be the start of the investigation, not a treasure hunt.

Why orchestrate this with Kestra

Wiring this with EventBridge + Lambda means scattered code and no visibility. As a Kestra flow the triage logic is declarative YAML the whole team can read, every run is logged and replayable, and adding a new diagnostic is one line in the diagnostic_commands input.

Prerequisites

  • AWS credentials with cloudwatch:GetMetricStatistics plus read permissions for whatever your diagnostic commands touch (e.g. ec2:DescribeInstances, logs:FilterLogEvents).
  • A Slack incoming webhook URL.

Secrets

  • AWS_ACCESS_KEY_ID: AWS access key for the CloudWatch and diagnostic API calls.
  • AWS_SECRET_ACCESS_KEY: AWS secret key for the CloudWatch and diagnostic API calls.
  • SLACK_WEBHOOK_URL: Incoming webhook URL for the triage alert.

Quick start

  1. Add the three secrets above to your Kestra namespace.
  2. Set metric_namespace, metric_name, and your read-only diagnostic_commands.
  3. Put your runbook URL in runbook_url.
  4. Trigger a test breach (or run manually) and check Slack.

How to extend

  • Add an If branch that pages via PagerDuty when diagnostics show a hard failure.
  • Feed the diagnostics into an LLM task for an auto-generated incident summary.
  • Store every triage bundle in S3 for post-incident review.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.