add-datadog-monitor

Creates Datadog monitors via Terraform covering log alerts, metric alerts, and composite error-rate patterns.

7|12|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/docs --skill add-datadog-monitor-openrouterteam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-datadog-monitor
Source: https://github.com/OpenRouterTeam/docs/tree/main/.agents/skills/add-datadog-monitor
Command: npx skills add https://github.com/OpenRouterTeam/docs --skill add-datadog-monitor-openrouterteam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a Datadog monitor in this repository requires Terraform-only workflows, strict naming and tagging conventions, and query patterns that pass both terraform validate and Datadog's own validation — mistakes surface late in CI or break the release train. This Skill encodes all of those conventions so a new monitor is correct on the first commit. ## Core Features & Use Cases - Monitor Templates: Provides ready-to-adapt HCL patterns for log alerts, metric/query alerts, log-based metrics, synthetic HTTP checks, and composite API error-rate monitors. - Convention Enforcement: Covers naming with ${var.name_prefix}, Slack channel selection, recovery thresholds, traffic gates, and lifecycle rules like create_before_destroy for composite-referenced monitors. - CI Validation Guidance: Explains how terraform validate and terraform plan run in GitHub Actions, and how to pre-validate queries against /api/v1/monitor/validate. - Use Case: You need an alert when 5xx errors on a new API route exceed 10% with sufficient traffic. The Skill directs you to add a route entry to the api_error_rate module's route_groups list rather than writing a standalone monitor. ## Quick Start Add a Datadog log alert monitor for failed generation batch inserts using Terraform following the repo conventions.

Frequently Asked Questions about add-datadog-monitor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a Datadog monitor with Terraform?▼

Create a new snake_case .tf file in configs/terraform-monitors/monitoring/ and define a datadog_monitor resource with a name prefixed by ${var.name_prefix}, a query, thresholds, and a Slack notification message. CI runs terraform validate automatically on push.

How do I set up an API error rate alert in Datadog?▼

Add an entry to the route_groups list in api_error_rate.tf instead of writing a standalone monitor. The module creates a traffic monitor, an error rate monitor, and a composite monitor that fires only when both traffic volume and error percentage exceed their thresholds.

Can I create Datadog monitors using the Datadog API directly?▼

No. The DD_API_KEY and DD_APP_KEY available in the environment are read-only and return 403 on write operations. All monitors in this repo must be managed exclusively through Terraform configuration files.

Why does my Datadog monitor query pass terraform validate but fail in CI?▼

terraform validate only checks HCL syntax; the query itself is validated by Datadog during terraform plan via POST /api/v1/monitor/validate. Read the failure reason from the terraform-plan-output workflow artifact, or pre-validate the query against the API endpoint before pushing.

When should I use create_before_destroy on a Datadog monitor?▼

Add a lifecycle block with create_before_destroy = true whenever the monitor's ID is referenced by a composite monitor. Without it, changing the monitor type forces a destroy that Datadog rejects because the composite still references the old ID.

What are the limitations of grouped ratio monitors in Datadog?▼

Grouped ratios using by clauses on both sides cannot carry an absolute traffic gate like the composite pattern, so near-zero-traffic groups can trigger alerts on a handful of events. Document this tradeoff, since the monitor validate API accepts the shape.