Datadog

Query and interact with Datadog using the dogshell CLI.

When to Use

Use this skill when asked to:

Setup

If dogshell isn’t installed, set it up via mise:

mise use python
pip install datadog

Reading Data

Command Purpose
dog metric query Query metric timeseries
dog monitor show <id> View monitor details
dog monitor show_all List all monitors
dog dashboard show_all List dashboards
dog downtime show_all List scheduled downtimes
dog tag show <host> Show tags for a host

Creating/Updating Resources

Command Purpose
dog monitor post Create a new monitor
dog monitor update <id> Update existing monitor
dog dashboard post Create a new dashboard
dog downtime post Schedule a downtime

Common Tasks

Query a Metric

dog metric query --start $(date -v-1H +%s) --end $(date +%s) "avg:trace.rack.request.duration{env:production}"

Time range options:

Check Monitor Status

dog monitor show_all
dog monitor show 12345

Create a Monitor

dog monitor post "metric alert" "avg(last_5m):avg:trace.rack.request.duration{env:production} > 1" --name "High Request Latency" --message "Request latency exceeded 1s"

Useful Metric Queries

Rails/Ruby performance metrics:

Infrastructure:

Query Syntax

Metrics follow the pattern: aggregation:metric.name{tags}

Aggregations: avg, sum, min, max, p50, p75, p90, p95, p99

Tags filter results: {env:production,service:api} or {*} for all.

Use .as_count() or .as_rate() to change how counters are displayed.