# Datadog on boxd

> Datadog offers monitoring, observability, and security for cloud-scale applications, unifying metrics, logs, and traces to help teams detect issues and optimize performance.

- Page: https://boxd.sh/integrations/datadog/
- CLI: `run datadog` (65 commands, 42 marked common)
- SDK: `import { datadog } from "@boxd/run"`; every parameter and response type is at `@boxd/run/datadog`
- Triggers: none
- Connect: `run auth datadog` (API key), or https://app.boxd.sh/integrations/detail/datadog
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth datadog      # once: prints a link to connect your account
run datadog           # list its commands
run datadog list-roles
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, datadog } from "@boxd/run";

every("1 hour", async () => {
  const result = await datadog.listRoles({});
  console.log(result);
});
```

Run it with `run datadog.run.ts`. Datadog has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run datadog <command> --help` lists the optional ones. "common" marks what `run datadog` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `aggregate-logs` ·common | `datadog.aggregateLogs()` | — | 4 | Aggregate Datadog logs without downloading raw events |
| `create-dashboard` ·common | `datadog.createDashboard()` | `--title` `--widgets` | 5 | Create a dashboard in Datadog |
| `create-downtime` ·common | `datadog.createDowntime()` | `--scope` | 7 | Creates a new downtime in Datadog to suppress alerts during maintenance windows or planned outages |
| `create-escalation-policy` ·common | `datadog.createEscalationPolicy()` | `--data` | 0 | Creates a Datadog On-Call escalation policy |
| `create-event` | `datadog.createEvent()` | `--text` `--title` | 8 | Creates a new event in Datadog |
| `create-monitor` ·common | `datadog.createMonitor()` | `--name` `--query` `--type` | 4 | Creates a new Datadog monitor to track metrics, logs, or other data sources with configurable alerting thresholds and notifications |
| `create-notification-channel` | `datadog.createNotificationChannel()` | `--data` `--user-id` | 0 | Creates an On-Call notification channel for a Datadog user |
| `create-notification-rule` | `datadog.createNotificationRule()` | `--data` `--user-id` | 0 | Creates an On-Call notification rule for a Datadog user |
| `create-schedule` ·common | `datadog.createSchedule()` | `--data` | 0 | Creates a Datadog On-Call schedule |
| `create-slo` ·common | `datadog.createSlo()` | `--name` `--thresholds` `--type` | 5 | Create a Service Level Objective (SLO) in Datadog |
| `create-synthetic-api-test` ·common | `datadog.createSyntheticApiTest()` | `--config` `--name` `--options` | 5 | Create a synthetic API test in Datadog |
| `create-webhook` ·common | `datadog.createWebhook()` | `--name` `--url` | 3 | Create a webhook in Datadog |
| `delete-dashboard` ·common | `datadog.deleteDashboard()` | `--dashboard-id` | 0 | Delete a dashboard in Datadog |
| `delete-escalation-policy` | `datadog.deleteEscalationPolicy()` | `--policy-id` | 0 | Deletes a Datadog On-Call escalation policy by ID |
| `delete-monitor` | `datadog.deleteMonitor()` | `--monitor-id` | 1 | Deletes a Datadog monitor permanently |
| `delete-notification-channel` | `datadog.deleteNotificationChannel()` | `--channel-id` `--user-id` | 0 | Deletes an On-Call notification channel for a Datadog user |
| `delete-notification-rule` | `datadog.deleteNotificationRule()` | `--rule-id` `--user-id` | 0 | Deletes an On-Call notification rule for a Datadog user |
| `delete-schedule` | `datadog.deleteSchedule()` | `--schedule-id` | 0 | Deletes a Datadog On-Call schedule by ID |
| `get-dashboard` ·common | `datadog.getDashboard()` | `--dashboard-id` | 0 | Get a specific dashboard from Datadog |
| `get-escalation-policy` | `datadog.getEscalationPolicy()` | `--policy-id` | 0 | Retrieves a Datadog On-Call escalation policy by ID |
| `get-monitor` | `datadog.getMonitor()` | `--monitor-id` | 2 | Retrieves detailed information about a specific Datadog monitor, including its current state, configuration, and any active downtimes |
| `get-notification-channel` | `datadog.getNotificationChannel()` | `--channel-id` `--user-id` | 0 | Retrieves an On-Call notification channel for a user by ID |
| `get-notification-rule` | `datadog.getNotificationRule()` | `--rule-id` `--user-id` | 0 | Retrieves an On-Call notification rule for a user by ID |
| `get-schedule` ·common | `datadog.getSchedule()` | `--schedule-id` | 0 | Retrieves a Datadog On-Call schedule by ID |
| `get-scheduled-on-call-user` | `datadog.getScheduledOnCallUser()` | `--schedule-id` | 0 | Gets the currently scheduled on-call user for a Datadog On-Call schedule |
| `get-service-dependencies` ·common | `datadog.getServiceDependencies()` | `--service` | 3 | Get service dependency mapping from Datadog APM |
| `get-synthetics-locations` ·common | `datadog.getSyntheticsLocations()` | — | 0 | Retrieve all available public and private locations for Synthetic tests in Datadog |
| `get-tags` ·common | `datadog.getTags()` | `--host-name` | 1 | Retrieves all tags associated with a specific host in Datadog |
| `get-team-on-call-users` | `datadog.getTeamOnCallUsers()` | `--team-id` | 0 | Gets the current on-call users for a Datadog On-Call team |
| `get-team-routing-rules` | `datadog.getTeamRoutingRules()` | `--team-id` | 0 | Gets the Datadog On-Call routing rules configured for a team |
| `get-trace-by-id` ·common ·deprecated | `datadog.getTraceById()` | `--trace-id` | 2 | Use search-traces instead |
| `get-usage-summary` | `datadog.getUsageSummary()` | `--start-month` | 2 | Retrieves usage summary information from Datadog including API calls, hosts, containers, and other billable usage metrics |
| `list-all-tags` ·common | `datadog.listAllTags()` | — | 1 | List all tags from Datadog |
| `list-api-keys` ·common | `datadog.listApiKeys()` | — | 7 | List API keys in Datadog |
| `list-apm-services` ·common | `datadog.listApmServices()` | — | 1 | List APM services from Datadog |
| `list-aws-integration` ·common | `datadog.listAwsIntegration()` | — | 2 | List AWS integrations in Datadog |
| `list-dashboards` | `datadog.listDashboards()` | — | 4 | Lists all Datadog dashboards with basic information |
| `list-events` | `datadog.listEvents()` | `--end` `--start` | 6 | Lists events from Datadog within a specified time range |
| `list-hosts` | `datadog.listHosts()` | — | 8 | Lists all hosts in your Datadog infrastructure with detailed information including metrics, tags, and status |
| `list-incidents` ·common | `datadog.listIncidents()` | — | 5 | List incidents from Datadog |
| `list-log-indexes` ·common | `datadog.listLogIndexes()` | — | 0 | Retrieve a list of all log indexes configured in Datadog, including their names and configurations |
| `list-metrics` ·common | `datadog.listMetrics()` | `--from-timestamp` | 2 | Discover metric names by listing actively reporting metrics since a given timestamp |
| `list-monitors` ·common | `datadog.listMonitors()` | — | 8 | Get all monitor details |
| `list-notification-channels` ·common | `datadog.listNotificationChannels()` | `--user-id` | 0 | Lists the On-Call notification channels configured for a Datadog user |
| `list-notification-rules` ·common | `datadog.listNotificationRules()` | `--user-id` | 0 | Lists the On-Call notification rules configured for a Datadog user |
| `list-roles` ·common | `datadog.listRoles()` | — | 4 | List roles from Datadog organization |
| `list-service-checks` | `datadog.listServiceChecks()` | — | 5 | Lists service checks from Datadog |
| `list-sl-os` ·common | `datadog.listSlOs()` | — | 4 | List Service Level Objectives (SLOs) from Datadog |
| `list-synthetics` ·common | `datadog.listSynthetics()` | — | 4 | List Synthetics tests from Datadog |
| `list-users` ·common | `datadog.listUsers()` | — | 5 | List users from Datadog organization |
| `list-webhooks` ·common | `datadog.listWebhooks()` | — | 1 | List webhooks from Datadog |
| `mute-monitor` ·common | `datadog.muteMonitor()` | `--monitor-id` | 2 | Mute a monitor in Datadog |
| `query-metrics` ·common | `datadog.queryMetrics()` | `--from-timestamp` `--query` `--to-timestamp` | 0 | Queries Datadog metrics and returns time series data |
| `search-logs` ·common | `datadog.searchLogs()` | `--query` `--time-from` `--time-to` | 3 | Searches Datadog logs with advanced filtering capabilities |
| `search-spans-analytics` ·common | `datadog.searchSpansAnalytics()` | `--filter` | 3 | Search and analyze span data with aggregations in Datadog |
| `search-traces` ·common | `datadog.searchTraces()` | `--filter` | 3 | Search for traces in Datadog APM |
| `set-team-routing-rules` ·common | `datadog.setTeamRoutingRules()` | `--data` `--team-id` | 0 | Replaces (sets) the On-Call routing rules for a Datadog team |
| `submit-metrics` ·common | `datadog.submitMetrics()` | `--series` | 0 | Submits custom metrics to Datadog |
| `unmute-monitor` ·common | `datadog.unmuteMonitor()` | `--monitor-id` | 1 | Unmute a monitor in Datadog |
| `update-dashboard` ·common | `datadog.updateDashboard()` | `--dashboard-id` | 10 | Update a dashboard in Datadog |
| `update-escalation-policy` ·common | `datadog.updateEscalationPolicy()` | `--data` `--policy-id` | 0 | Updates a Datadog On-Call escalation policy by ID |
| `update-host-tags` | `datadog.updateHostTags()` | `--host-name` `--tags` | 1 | Updates tags for a specific host in Datadog |
| `update-monitor` | `datadog.updateMonitor()` | `--monitor-id` | 7 | Updates an existing Datadog monitor with new configuration, thresholds, or notification settings |
| `update-notification-rule` | `datadog.updateNotificationRule()` | `--data` `--rule-id` `--user-id` | 0 | Updates an On-Call notification rule for a user by ID |
| `update-schedule` ·common | `datadog.updateSchedule()` | `--data` `--schedule-id` | 0 | Updates a Datadog On-Call schedule by ID |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
