Inspect Datadog monitors, incidents, logs, and dashboards with dry-run mutations.
- Other
- datadog
- monitors
- incidents
- logs
- dashboards
- observability
- alerts
- dry-run
- License
- MIT
- Published
- August 22, 2026
- Pinned commit
24a475b- Rating
- No ratings yet
- Forks
- 0
- Stars
- 0
- Adaptation effort
- —
README
@kody/datadog
Intent
Official Datadog helpers so Kody agents can inspect the caller's monitors,
incidents, logs, and dashboards — not a shared org. Auth is a saved API key
plus application key, not OAuth. Reads are free-form. Creates, updates,
deletes, mute, and unmute support dryRun: true and require confirm: true
before they contact Datadog.
This listing is meant to be forked. After you fork, save your own
datadogApiKey and datadogApplicationKey and call the helpers in your
account. No organization names, monitor IDs, or dashboard IDs are baked in.
Agent setup
- In Datadog, open Organization Settings → API Keys and Application Keys. Create one of each. Scope the application key to the minimum permissions you need (monitors, incidents, logs, dashboards).
- Save both secrets in Kody (do not paste the values in chat):
- In the account secrets UI, approve the Datadog API hosts you use
(at least
api.datadoghq.comfor US1). - Share this listing as https://kody.codes/@kody/datadog
Auth
API key + application key (secret-backed). There is no Datadog OAuth
integration in this package. Do not open /connect/oauth for Datadog.
| Secret | Purpose |
|---|---|
datadogApiKey | Organization API key (DD-API-KEY) |
datadogApplicationKey | Application key (DD-APPLICATION-KEY) |
Every request sends both headers. Submission-only endpoints that accept only an API key are out of scope here.
Hosts and sites
Pass site when the account is not US1. Aliases: us1, us3, us5, eu,
ap1, ap2, uk1, gov.
| Site | API host |
|---|---|
us1 (default) | api.datadoghq.com |
us3 | api.us3.datadoghq.com |
us5 | api.us5.datadoghq.com |
eu | api.datadoghq.eu |
ap1 | api.ap1.datadoghq.com |
ap2 | api.ap2.datadoghq.com |
uk1 | api.uk1.datadoghq.com |
gov | api.ddog-gov.com |
Multi-account
Pass account: "work" to use secrets datadogApiKey-work and
datadogApplicationKey-work. Or pass apiKeySecretName /
applicationKeySecretName. There are no hard-coded account aliases.
Exports
kody:@kody/datadog— action dispatcher (defaults tosmoke-test); also re-exports every helper belowkody:@kody/datadog/validate— validate the API key and read the current userkody:@kody/datadog/monitors— list/search/get; create/update/delete/mute/unmute withdryRunkody:@kody/datadog/incidents— list/search/get; create/update/delete withdryRunkody:@kody/datadog/logs— search logs (POST /api/v2/logs/events/search)kody:@kody/datadog/dashboards— list/get; create/update/delete withdryRunkody:@kody/datadog/smoke-test— dry-run self-check, then a live read when both secrets existkody:@kody/datadog/scheduled-status— no-argument monitor-state wrapper used by the disabled job
Mutation safety
- Pass
dryRun: trueon any write to return{ dryRun: true, method, path, host }without contacting Datadog. - Live writes also throw unless
confirm: true. - Do not create, mute, or delete anyone's monitors, incidents, or dashboards from a smoke test or scheduled job.
import { createMonitor, deleteMonitor } from 'kody:@kody/datadog/monitors'
const preview = await createMonitor({
type: 'query alert',
query: 'avg(last_5m):avg:system.cpu.user{*} > 95',
name: 'High CPU',
dryRun: true,
})
const deleted = await deleteMonitor({
monitorId: 12345,
confirm: true,
})Jobs
The monitor-status job is declared disabled. It is a no-argument wrapper
around scheduled-status (read-only monitor state counts). Enable it only
after you confirm the keys, hosts, and site you want it to use.
Smoke test
import datadog from 'kody:@kody/datadog'
export default async function main() {
return await datadog()
}Without both secrets this still returns { ok: true, live: false } plus the
setup URLs. With the secrets saved it validates the keys and lists a sample of
monitors and dashboards — no writes.
Example
import datadog from 'kody:@kody/datadog'
export default async function main() {
return await datadog({
action: 'search-logs',
query: 'status:error',
from: 'now-15m',
to: 'now',
})
}Branding
community-icon.svg is Datadog's official Bits mark (Simple Icons datadog,
sourced from Datadog brand assets) on Datadog purple #632CA6. Datadog® is a
trademark of Datadog, Inc. This package is not affiliated with or endorsed by
Datadog.
Docs
Report this listing
Log in to report this listing.