Datadog
Datadog — monitors, downtimes, users
weave datadog
Env: DATADOG_API_KEY
Setup
Configure credentials via environment variables. We recommend sourcing them through 1Password or your secrets manager rather than committing them to the shell rc.
Official API reference
weave commands for this module are checked against the vendor's published API.
| Variable | Description | Status |
|---|---|---|
| DATADOG_API_KEY | Required for authentication. | required |
| DATADOG_APP_KEY | Required for authentication. | required |
| DATADOG_SITE | Datadog site (e.g. datadoghq.com, datadoghq.eu, us3.datadoghq.com). | optional |
| DATADOG_API_URL | Full API URL override when using a custom site. | optional |
Sanity-check the wiring:
weave secrets check weave datadog --help weave doctor # reports DATADOG_API_KEY status
Capabilities
What this module can do, by entity and verb. ✓
means a working CLI surface; · means
not (yet) wired.
| Entity | find | list | show | do | snapshot | diff | apply |
|---|---|---|---|---|---|---|---|
| downtime | · | ✓ | · | ✓ | · | · | · |
| monitor | ✓ | ✓ | · | · | ✓ | ✓ | ✓ |
| user | ✓ | · | · | · | · | · | · |
Commands
Every registered CLI command, grouped by verb. Each example uses placeholder arguments — substitute real values for your environment.
find (2)
find monitor
readFind a monitor by name or id.
weave datadog find monitor <identifier>
find user
readFind a Datadog user by email.
weave datadog find user <email>
list (2)
list downtimes
readList active and scheduled downtimes.
weave datadog list downtimes <arg>
list monitors
readList monitors (optionally by tag).
weave datadog list monitors <arg>
do (2)
do cancel-downtime
writeCancel an active downtime by id.
weave datadog do cancel-downtime <downtime-id>
do schedule-downtime
writeSchedule a downtime for a scope.
weave datadog do schedule-downtime <scope>
snapshot → edit YAML →
diff → apply --yes (or confirm
interactively; apply --dry-run previews the same diff).
State kinds
Resources this module can snapshot and
diff; apply where the kind supports
live writes (see Round-trip per kind). Always run
diff before apply; use
--yes in automation after review. Files live under
.weave-state/datadog/.
monitors
All monitors on the Datadog account (name + type are the key).
State file skeleton
module: datadog kind: monitors items: - # <fields specific to this kind — see snapshot output>
Workflows
End-to-end recipes from operators who already run this module in production. Copy, adapt, and put under change-control.
Version-control monitors
weave datadog snapshot monitors $EDITOR .weave-state/datadog/monitors.yaml weave datadog diff monitors weave datadog apply monitors --yes
Silence an alert during maintenance
weave datadog find monitor "High CPU on prod-db" weave datadog do schedule-downtime --scope=host:prod-db-01 --duration=2h --yes # after maintenance: weave datadog do cancel-downtime <downtime-id>
Audit active downtimes
weave datadog list downtimes
Find an on-call engineer's Datadog user
weave datadog find user oncall@company.com
Terraform parity
For each Terraform resource in the canonical provider, here's the equivalent live-API verb in weave. Use this as a migration cheat-sheet, not a 1:1 contract — weave deliberately stays in the live-state lane, not the desired-state lane.
| Terraform resource | weave equivalent |
|---|---|
| datadog_monitor | weave datadog snapshot/diff/apply monitors + find/list monitor |
| datadog_downtime | weave datadog list downtimes + do schedule-downtime / cancel-downtime Downtimes are operational — weave schedules/cancels live, not full YAML round-trip. |
| datadog_user | weave datadog find user User CRUD not exposed — find-only for correlation during incidents. |
Troubleshooting & source
Run weave doctor — it reports which env
vars (including DATADOG_API_KEY) are set
and which are blank.
Re-run weave datadog diff <kind>
to confirm the controller's current state, then re-snapshot
before the next apply. The driver always re-snapshots
before diffing.
The module lives at https://github.com/andy-broyles/weavewhatever/tree/main/src/weave/modules/datadog. File a bug or feature request at https://github.com/andy-broyles/weavewhatever/issues.