# @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. ## What it does - Validate API + application keys and read the current Datadog user - List, search, and get monitors, incidents, and dashboards - Search logs (`POST /api/v2/logs/events/search`) - Create / update / delete / mute / unmute with `dryRun` preview and `confirm: true` for live writes - Optional (disabled) `monitor-status` job for read-only monitor state counts ## Prerequisites / setup 1. In Datadog, open [Organization Settings → API Keys](https://app.datadoghq.com/organization-settings/api-keys) and [Application Keys](https://app.datadoghq.com/organization-settings/application-keys). Create one of each. Scope the application key to the minimum permissions you need (monitors, incidents, logs, dashboards). 2. Save both secrets in Kody (do not paste the values in chat): https://kody.codes/account/secrets/new?name=datadogApiKey&description=Datadog%20API%20key%20for%20the%20HTTP%20API&allowedHosts=api.datadoghq.com,api.us3.datadoghq.com,api.us5.datadoghq.com,api.datadoghq.eu,api.ap1.datadoghq.com,api.ap2.datadoghq.com,api.uk1.datadoghq.com,api.ddog-gov.com,api.us2.ddog-gov.com&scope=user https://kody.codes/account/secrets/new?name=datadogApplicationKey&description=Datadog%20application%20key%20for%20read%20and%20management%20API%20calls&allowedHosts=api.datadoghq.com,api.us3.datadoghq.com,api.us5.datadoghq.com,api.datadoghq.eu,api.ap1.datadoghq.com,api.ap2.datadoghq.com,api.uk1.datadoghq.com,api.ddog-gov.com,api.us2.ddog-gov.com&scope=user 3. In the account secrets UI, approve the Datadog API hosts you use (at least `api.datadoghq.com` for US1). 4. Pass `site` when the account is not US1 (`us3`, `us5`, `eu`, `ap1`, `ap2`, `uk1`, `gov`). For a second account, save `datadogApiKey-work` / `datadogApplicationKey-work` and pass `account: "work"`. 5. Share this listing as https://kody.codes/@kody/datadog There is **no** Datadog OAuth integration in this package — do not open `/connect/oauth` for Datadog. Agents: import paths, smoke checks, and mutation snippets live in [`AGENTS.md`](./AGENTS.md). ## Done when - Both secrets are saved and the needed Datadog API hosts are approved - Smoke test returns `{ ok: true, live: true, … }` (or `{ live: false }` with setup URLs when credentials are missing) - Write helpers preview with `dryRun: true` and only run live with `confirm: true` after you approve the target ## 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 - [Authentication](https://docs.datadoghq.com/api/latest/authentication/) - [Monitors](https://docs.datadoghq.com/api/latest/monitors/) - [Incidents](https://docs.datadoghq.com/api/latest/incidents/) - [Logs](https://docs.datadoghq.com/api/latest/logs/) - [Dashboards](https://docs.datadoghq.com/api/latest/dashboards/) - [API and application keys](https://docs.datadoghq.com/account_management/api-app-keys/)