Manages Datadog operations via dogshell CLI - metrics, monitors, dashboards, events, SLOs, downtimes, and tags. Use when querying Datadog, posting metrics, managing monitors, or working with Datadog API via command line.
npx claudepluginhub andercore-labs/claudes-kitchen --plugin operational-excellenceThis skill uses the workspace's default tool permissions.
**SCOPE:** dogshell CLI for Datadog API operations.
Conducts multi-round deep research on GitHub repos via API and web searches, generating markdown reports with executive summaries, timelines, metrics, and Mermaid diagrams.
Dynamically discovers and combines enabled skills into cohesive, unexpected delightful experiences like interactive HTML or themed artifacts. Activates on 'surprise me', inspiration, or boredom cues.
Generates images from structured JSON prompts via Python script execution. Supports reference images and aspect ratios for characters, scenes, products, visuals.
SCOPE: dogshell CLI for Datadog API operations.
# Setup
pip install datadog
echo "api_key = YOUR_API_KEY" > ~/.dogrc
echo "app_key = YOUR_APP_KEY" >> ~/.dogrc
# Common operations
dog metric post my.metric 100 --tags "env:prod,service:api"
dog monitor show 12345
dog event post "Deploy completed" --tags "env:prod"
dog slo show abc123
Post metrics | Query monitors | Manage SLOs | Create events | Schedule downtimes | Tag hosts | Dashboard operations
# Install
pip install datadog
# Auth methods (priority order):
1. CLI flags: --api-key KEY --app-key KEY
2. Environment: export DATADOG_API_KEY=... DATADOG_APP_KEY=...
3. Config file: ~/.dogrc
~/.dogrc format:
[Connection]
apikey = YOUR_API_KEY
appkey = YOUR_APP_KEY
api_host = https://api.datadoghq.com # Optional: EU → api.datadoghq.eu
1Password integration:
# Store in 1Password
op item create \
--category=api-credential \
--title="Datadog API" \
api_key=YOUR_API_KEY \
app_key=YOUR_APP_KEY
# Retrieve
export DATADOG_API_KEY=$(op item get "Datadog API" --fields api_key)
export DATADOG_APP_KEY=$(op item get "Datadog API" --fields app_key)
| Command | Purpose | Example |
|---|---|---|
| metric | Post/query metrics | dog metric post cpu.usage 75 |
| monitor | CRUD monitors | dog monitor show 12345 |
| event | Post events | dog event post "Deploy v1.2" |
| slo | Manage SLOs | dog slo show abc123 |
| downtime | Schedule downtimes | dog downtime schedule |
| tag | Manage host tags | dog tag show host123 |
| dashboard | Manage dashboards | dog dashboard show dash-id |
| host | Query hosts | dog host show host123 |
| search | Search Datadog | dog search query "service:api" |
# Basic
dog metric post my.metric VALUE
# With tags
dog metric post api.latency 250 --tags "env:prod,region:us-east-1"
# Scoped to host
dog metric post cpu.usage 80 --host web-01
# No host association
dog metric post batch.processed 1000 --no_host
# With device
dog metric post disk.usage 75 --device /dev/sda1
# Metric types
dog metric post requests.count 100 --type counter # 64bit integer
dog metric post cpu.percent 45.5 --type gauge # 32bit float
Tag format:
key:value,key2:value2
env:prod,service:api,version:1.2.0
# Via search
dog search query "metric:api.latency env:prod"
dog monitor show MONITOR_ID
# Multiple
dog monitor show 12345 67890
dog monitor show_all
# Filter by tags
dog monitor show_all --tags "env:prod,service:api"
# Filter by group
dog monitor show_all --group_states "alert,warn"
# Filter by name
dog monitor show_all --name "API Latency"
# Not directly supported via dogshell
# Use Python API or Datadog UI
# Alternative: Use Datadog Terraform provider
dog monitor mute MONITOR_ID
# With scope
dog monitor mute MONITOR_ID --scope "env:staging"
# With end time
dog monitor mute MONITOR_ID --end $(date -d "+2 hours" +%s)
# Unmute
dog monitor unmute MONITOR_ID
dog monitor delete MONITOR_ID
# Basic
dog event post "Deployment completed"
# With text body
dog event post "Deploy v1.2.0" --text "Deployed to production"
# With tags
dog event post "Deploy" --tags "env:prod,version:1.2.0"
# With priority
dog event post "Critical issue" --priority "normal" # normal | low
# With alert type
dog event post "Service down" --alert_type "error" # error | warning | info | success
# With aggregation key
dog event post "Deploy" --aggregation_key "deploy-123"
# With source type
dog event post "Deploy" --source_type_name "jenkins"
# With host
dog event post "Deploy" --host "web-01"
dog event show EVENT_ID
# Via search
dog search query "sources:jenkins"
dog search query "tags:env:prod"
dog slo show SLO_ID
# With time window
dog slo show abc123 --from_ts $(date -d "-30 days" +%s) --to_ts $(date +%s)
dog slo show_all
# Filter by tags
dog slo show_all --tags "env:prod"
# Filter by IDs
dog slo show_all --ids "abc123,def456"
# History
dog slo history SLO_ID
# With time window
dog slo history abc123 --from_ts $(date -d "-7 days" +%s) --to_ts $(date +%s)
# Basic (1 hour from now)
dog downtime schedule "scope:env:staging"
# With message
dog downtime schedule "host:web-01" --message "Maintenance window"
# With start/end time
dog downtime schedule "service:api" \
--start $(date +%s) \
--end $(date -d "+2 hours" +%s)
# Recurring (not supported via CLI, use Python API)
dog downtime show DOWNTIME_ID
dog downtime show_all
# Current only
dog downtime show_all --current_only
dog downtime cancel DOWNTIME_ID
dog tag show HOST
# By source
dog tag show web-01 --source "chef"
dog tag add HOST TAG1 TAG2
# Examples
dog tag add web-01 "env:prod" "role:webserver"
# Replace all tags
dog tag update HOST TAG1 TAG2
# By source
dog tag update web-01 "env:prod" --source "terraform"
dog tag detach HOST
# By source
dog tag detach web-01 --source "ansible"
dog dashboard show DASHBOARD_ID
dog dashboard show_all
dog host show HOST
# With from timestamp
dog host show web-01 --from $(date -d "-1 hour" +%s)
dog host mute HOST
# With message
dog host mute web-01 --message "Planned maintenance"
# With end time
dog host mute web-01 --end $(date -d "+2 hours" +%s)
# Override (end previous mute)
dog host mute web-01 --override
dog host unmute HOST
# Search hosts
dog search hosts "role:webserver"
# Search metrics
dog search metrics "metric:api.*"
# General query
dog search query "tags:env:prod service:api"
# Post service check
dog service_check check SERVICE_CHECK_NAME HOST STATUS
# Statuses: 0 (OK), 1 (WARNING), 2 (CRITICAL), 3 (UNKNOWN)
dog service_check check api.health web-01 0
# With message
dog service_check check db.connection db-01 2 --message "Connection timeout"
# With tags
dog service_check check cache.available redis-01 0 --tags "env:prod"
# With timestamp
dog service_check check api.health web-01 0 --timestamp $(date +%s)
See patterns.md for:
| Variable | Purpose | Example |
|---|---|---|
| DATADOG_API_KEY | API key (fallback to DD_API_KEY) | export DATADOG_API_KEY=... |
| DATADOG_APP_KEY | App key (fallback to DD_APP_KEY) | export DATADOG_APP_KEY=... |
| DD_API_KEY | API key (alternative) | export DD_API_KEY=... |
| DD_APP_KEY | App key (alternative) | export DD_APP_KEY=... |
| DD_SITE | Datadog site | export DD_SITE=datadoghq.eu |
| Issue | Check | Fix |
|---|---|---|
| Command not found | dogshell installed? | pip install datadog |
| Authentication failed | Credentials set? | Check ~/.dogrc or env vars |
| 403 Forbidden | App key valid? | Verify app_key permissions |
| 404 Not Found | Resource exists? | Verify ID via UI |
| Timeout | Network/API slow? | Increase timeout or retry |
| Invalid tags | Format correct? | Use key:value,key2:value2 |
dogshell modules:
Python library: https://github.com/DataDog/datadogpy Datadog API: https://docs.datadoghq.com/api/ dogshell docs: https://docs.datadoghq.com/developers/guide/dogshell/