-
Notifications
You must be signed in to change notification settings - Fork 0
First Monitor
Garot Conklin edited this page Feb 12, 2025
·
1 revision
This guide will walk you through creating and deploying your first DataDog monitor using the DataDog Monitor Deployer.
- DataDog Monitor Deployer installed (
pip install datadog-monitor-deployer) - DataDog API and Application keys configured
- Basic understanding of DataDog monitors
Create a file named monitor.yaml with the following content:
monitors:
- name: "High CPU Usage Alert"
type: "metric alert"
query: "avg(last_5m):avg:system.cpu.user{*} > 80"
message: |
CPU usage is above 80%
{{#is_alert}}
System is experiencing high CPU usage.
Please investigate immediately.
{{/is_alert}}
{{#is_recovery}}
CPU usage has returned to normal levels.
{{/is_recovery}}
tags:
- "env:production"
- "service:web"
- "team:platform"
priority: 2
options:
notify_no_data: true
no_data_timeframe: 10
notify_audit: false
timeout_h: 0
evaluation_delay: 900
new_host_delay: 300
include_tags: true
require_full_window: false
renotify_interval: 60
thresholds:
critical: 80
warning: 70
ok: 60Before deploying, validate your monitor configuration:
dd-monitor validate monitor.yamlDeploy your monitor to DataDog:
dd-monitor deploy monitor.yaml- Log into your DataDog account
- Navigate to Monitors > Manage Monitors
- Find your newly created "High CPU Usage Alert" monitor
- Verify the configuration matches your YAML file
Let's break down the key components of the monitor configuration:
-
name: The display name of your monitor -
type: The type of monitor (e.g., "metric alert", "log alert") -
query: The monitor's detection query -
message: The notification message (supports templating)
-
tags: Labels for organizing and filtering monitors -
priority: Importance level (1-5, where 1 is highest)
-
notify_no_data: Whether to alert when data is missing -
evaluation_delay: Delay before evaluating data points -
thresholds: Alert and recovery thresholds
- Learn about different monitor types
- Explore templating options
- Understand best practices
- Set up automated deployments
- Verify your API credentials
- Check the deployment command output
- Ensure the YAML syntax is correct
- Verify the query syntax
- Check threshold values and operators
- Validate the configuration file