Datadog Alerting
Quote
“Nines don’t matter if users aren’t happy.”
— Charity Majors, charity.wtf (2019)
Summary
This note moves from visibility to action: it defines the monitor layer that converts Datadog metrics into deadlock alerts, Airflow health notifications, severity guidance, and dashboard thresholds so operators know not just what changed, but when the platform should page, warn, or stay quiet.
SQL Server monitors
- Starts with the DBA monitor set, including the deadlock alert and its test path, so database contention becomes a detectable operational event.
- Keeps alert design close to the signals that matter for correctness and throughput on the SQL side.
Airflow monitors
- Defines orchestration monitors and the priority guide that distinguishes urgent failures from useful but lower-noise warnings.
- Frames alerting as a policy choice about operator attention, not a mechanical translation of every metric into a page.
Threshold display
- Covers dashboard conditional formatting so the same severity logic is visible in dashboards, not just in monitor state changes.
- Connects alert rules and dashboards into one visual language for triage.
Noise control
- Ends with GCE host automuting and related practices that keep planned infrastructure actions from becoming false incidents.
- When to use: the metrics and dashboards exist and the next job is to define which conditions deserve human interruption.
Glossary
monitor
A Datadog rule that evaluates telemetry and changes state when its condition is met.
It matters here because the note is about turning passive visibility into active notification.
Alerting rule object
Dashboards show state; monitors decide when that state is important enough to escalate.
threshold
The numeric or logical boundary that separates normal behavior from warning or alert conditions.
It matters here because a monitor is only as useful as the boundary it uses to define abnormal behavior.
Thresholds encode policy
Good thresholds reflect business risk and noise tolerance, not just arbitrary round numbers.
priority
The severity or urgency assigned to a monitor so responders know how quickly to act.
It matters here because not every Airflow or SQL symptom deserves the same interruption level.
Urgency ladder
Priority helps preserve human attention for conditions that actually threaten freshness, correctness, or uptime.
notification channel
The destination a Datadog monitor uses to reach people or systems when it changes state.
It matters here because alert value depends on the message reaching the right responder path.
Signal needs routing
A correct monitor with the wrong receiver behaves like a silent failure.
recovery condition
The rule that determines when an alert returns to a healthy state.
It matters here because noisy flapping often comes from poor recovery logic rather than poor trigger logic.
Alerts need an exit
The team needs to know not only when something broke, but also when it actually returned to normal.
conditional formatting
Dashboard color or display logic that mirrors severity thresholds visually.
It matters here because operators often scan dashboards before opening monitor histories.
Visual severity language
Using the same boundaries in widgets and monitors reduces cognitive translation during triage.
automuting
The suppression of alerts during known and intentional infrastructure state changes.
It matters here because planned VM stops should not look like incidents.
Expected silence
Mute logic protects alert quality by reserving pages for unexpected conditions.
deadlock alert
A monitor that fires when SQL Server deadlock activity crosses the chosen threshold.
It matters here because deadlocks are both actionable and directly tied to application throughput risk.
Alert on actionable contention
Deadlock monitoring works well because the corrective investigation path is usually concrete and time-sensitive.
SQL Server DBA Monitors
Deadlock Alert Monitor
The most critical SQL Server monitor — triggers an email alert whenever a deadlock occurs.
Deadlock Alert Monitor Setup
- Go to Monitors > New Monitor > Metric
- Detection method: Change Alert
- Metric:
sqlserver.deadlocks.total - Alert condition: change over
last 5 minutesis above 0 - Title: “SQL Server Deadlock Detected”
- Message:
{{#is_alert}}
Deadlock detected on {{host.name}}.
1. Check active locks: SELECT * FROM sys.dm_tran_locks WHERE request_status = 'WAIT'
2. Review Extended Events deadlock graph
3. Identify conflicting queries and fix access order
{{/is_alert}}
{{#is_recovery}}
Deadlock alert resolved on {{host.name}}.
{{/is_recovery}}
Notify: @oncall-team@example.com
- Tags:
env:prod,service:data-pipeline-sql - Click Create
The monitor triggers immediately when a deadlock occurs and sends an email with remediation steps. It auto-resolves when no new deadlocks are detected in the evaluation window. When a P1 or P2 alert fires, follow the response procedures in the on call guide to ensure consistent triage and escalation.
Testing the Deadlock Alert
To verify the full pipeline (deadlock → metric → monitor → email):
- Create a deadlock using the procedure in the SQL Server Tuning Guide, Section 5.8
- Wait 15-30 seconds for the Datadog agent to collect the updated counter
- The monitor should trigger and send an email within 1-2 minutes
- The Deadlock Count widget on the SQL Server DBA dashboard should increment
Why change alert
sqlserver.deadlocks.totalis amonotonic_count— it resets to 0 each collection cycle when no new deadlocks occur. A Change Alert detects when the value increases from 0, which is more reliable than a threshold alert for delta-based metrics.
Monitor evaluation delay
Datadog evaluates monitors on a fixed interval (typically 60 seconds). A deadlock that occurs and resolves within one evaluation cycle may never trigger the alert. For critical monitors, set the evaluation window to the smallest supported interval and consider enabling
require_full_window: falseso partial data triggers the alert rather than waiting for a full window.
Minimize Missed Deadlock Alerts
Set the monitor’s evaluation window to
last 1 minute(the minimum), enablerequire_full_window: falsein the monitor’s advanced settings, and use a Change Alert onsqlserver.deadlocks.totalrather than a threshold — this fires as soon as the counter increments, even within a single collection cycle.
Recovery notification flood
When a monitor recovers, Datadog sends a recovery notification to all channels. If a flapping metric (e.g., scheduler heartbeat on a slow VM) triggers and recovers repeatedly, the on-call engineer receives dozens of notifications. Use
notify_no_data: truewithno_data_timeframe: 10(minutes) instead of a tight threshold to reduce noise for heartbeat-style monitors.
Suppress Flapping Notifications
For heartbeat-style monitors, set Alert condition to “no data for 5 minutes” rather than a threshold, enable
notify_no_data: truewithno_data_timeframe: 10, and add a renotification interval of at least 30 minutes. This ensures a single alert per incident rather than a flood for each flap cycle.
Airflow Orchestration Monitors
Create these in Monitors → New Monitor → Metric:
| Monitor | Metric | Condition | Severity |
|---|---|---|---|
| Scheduler Down | airflow.scheduler_heartbeat | No data for 5 min | P1 (Critical) — see airflow scheduler down |
| DAG Parse Error | airflow.dag_processing.import_errors | > 0 for 5 min | P2 (High) |
| Task Failure | airflow.ti.finish.*.failed | > 0 within 15 min | P2 (High) |
| Pool Starvation | airflow.pool.starving_tasks.default_pool | > 0 for 10 min | P3 (Medium) |
| DAG Duration Anomaly | airflow.dagrun.duration.success.pipeline_pulse.avg | > 2x baseline for 3 consecutive runs | P3 (Medium) |
| Queued Duration Spike | airflow.dag.*.queued_duration.95percentile | > 60,000,000 (60s) | P4 (Low) |
| Triggerer Down | airflow.triggerer_heartbeat | No data for 5 min | P3 (Medium) |
Airflow Monitor Priority Guide
| Priority | Use For | Response Time |
|---|---|---|
| P1 (Critical) | Scheduler down — pipeline is completely blocked (see also sql server disk full for disk-related critical alerts) | Immediate |
| P2 (High) | DAG parse errors, task failures — pipeline quality at risk | Within 30 min |
| P3 (Medium) | Pool starvation, triggerer down, duration anomaly | Within 2 hours |
| P4 (Low) | Queued duration spikes — performance degradation only | Next business day |
Airflow Duration Units
Airflow emits durations in microseconds. The Queued Duration Spike threshold of 60,000,000 equals 60 seconds. Adjust based on your typical DAG run times from the Airflow dashboard.
Dashboard Conditional Formatting
In addition to monitors (which send notifications), the SQL Server DBA dashboard uses conditional formatting on Query Value widgets for at-a-glance status:
Deadlock Count Widget
| Condition | Background |
|---|---|
| value = 0 | Green |
| value > 0 | Red |
Buffer Cache Hit Ratio Widget
| Condition | Background |
|---|---|
| value > 99 | Green |
| value > 95 | Yellow |
| value ≤ 95 | Red |
GCE Host Automuting in Datadog
When GCE Automuting is enabled in the GCP Integration, monitors are automatically muted when a VM is stopped in GCP. This prevents false alerts during intentional maintenance or off-hours cost reduction when the SQL or Airflow VM is stopped.
Enable in: Integrations > Google Cloud Platform > Edit > GCE Automuting = ON
Related
- datadog-dashboards — Dashboard widgets with conditional formatting
- datadog-custom-queries —
sqlserver.deadlocks.totalmetric source - datadog-agent-airflow-vm — StatsD source for Airflow scheduler metrics
- datadog-gcp-integration — GCE Automuting for VM stop/start
- essential-dba-queries — Manual queries to investigate after a deadlock alert