Schedule icon
Script icon
If icon
Create icon
SlackIncomingWebhook icon
Log icon

Datadog Active Monitor Alert and Incident Sync Sentinel

Monitor active Datadog alerts with Kestra. Automatically query alerting monitors, synchronize incident tickets on GitHub, and alert SRE teams on Slack.

Categories
CloudInfrastructure

Production incidents frequently trigger multiple cascading alerts across Datadog monitors. Without centralized orchestration, engineers must manually cross-reference dashboards, open tracking tickets, and ping response channels. This blueprint polls Datadog's API for monitors in an active Alert state matching service and environment tags, automatically creates a consolidated GitHub incident issue with full monitor metadata, and dispatches an actionable Slack notification.

How it works

  1. every_fifteen_minutes (io.kestra.plugin.core.trigger.Schedule) executes the audit periodically (shipped disabled for safe manual testing).
  2. probe_datadog_alerts (io.kestra.plugin.scripts.python.Script) interrogates the Datadog API (GET /api/v1/monitor) with specified tag filters and extracts monitors in overall_state: Alert.
  3. branch_on_active_alerts (io.kestra.plugin.core.flow.If) evaluates whether alert_count > 0:
    • then: Automatically files a GitHub tracking issue via create_incident_github_issue (io.kestra.plugin.github.issues.Create) and dispatches a notification via notify_sre_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).
    • else: Emits an informational log entry (log_all_monitors_healthy) confirming all monitors are healthy.
  4. log_audit_complete (io.kestra.plugin.core.log.Log) prints an audit log recording the monitor count for the run.
  5. The errors block alerts Slack if API tokens are invalid or network connectivity fails.

What you get

  • Automated, centralized tracking of Datadog monitor breaches.
  • Zero manual ticket creation when critical infrastructure alerts fire.
  • Consolidated GitHub incident tickets with monitor IDs, names, and alert summaries.
  • Instant Slack alerts with direct hyperlinks to GitHub incident tracking issues.

Who it's for

  • SRE and DevOps teams managing production infrastructure monitored by Datadog.
  • Platform engineers establishing incident response and post-mortem tracking.
  • Incident commanders coordinating rapid outage triage.

Why orchestrate this with Kestra

Kestra bridges monitoring systems (Datadog), engineering issue trackers (GitHub), and team communication platforms (Slack) into a single declarative workflow. It manages API credentials securely, provides auditability for every inspection cycle, and simplifies incident alerting without custom cron daemons or fragile microservices.

Prerequisites

  • A Datadog account with API and Application keys created under Organization Settings.
  • A GitHub Personal Access Token with repository issue creation permissions.
  • A Slack incoming webhook URL for SRE alerts.

Secrets

  • DATADOG_API_KEY: Datadog API key for authentication.
  • DATADOG_APP_KEY: Datadog Application key for querying monitors.
  • GITHUB_TOKEN: GitHub token used to open incident issues.
  • SLACK_WEBHOOK: Slack incoming webhook URL for incident notifications.

Inputs

  • datadog_site (STRING, default datadoghq.com): Datadog site domain (datadoghq.com, datadoghq.eu, us3.datadoghq.com, etc.).
  • monitor_tags (STRING, default env:prod,service:backend): Comma-separated tag filter used to restrict audited monitors.
  • github_repository (STRING, default my-org/sre-incidents): GitHub repository (owner/repo) where incident tickets are created.

Outputs

  • outputs.probe_datadog_alerts.vars.alert_count: The number of monitors discovered in Alert status.
  • outputs.probe_datadog_alerts.vars.has_alerts: Boolean indicator if any active alerts exist.
  • outputs.probe_datadog_alerts.vars.alerting_monitors: List of monitor summary objects (id, name, type, message).

Quick start

  1. Configure the DATADOG_API_KEY, DATADOG_APP_KEY, GITHUB_TOKEN, and SLACK_WEBHOOK secrets.
  2. Import this flow and set datadog_site and monitor_tags to match your environment.
  3. Trigger a manual execution to verify monitor polling and Slack message delivery.
  4. Enable the every_fifteen_minutes schedule trigger to establish automated continuous incident monitoring.

How to extend

  • Add an automated incident mitigation task (e.g. restart a Kubernetes deployment or scale an autoscaling group).
  • Dispatch paging alerts to PagerDuty or Opsgenie alongside GitHub issue creation.
  • Filter monitors by severity priority tags (e.g., priority:p1) to route high-severity alerts to an urgent war room.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.