> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/datadog.md).

# Datadog

Datadog is an observability platform. Connect to query metrics, search logs and events, report on browser telemetry with RUM, inspect monitors, and declare incidents.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication   |
| --------- | ---------------- |
| Datadog   | API key or token |

#### Datadog

Connect to Datadog to query metrics, search logs and events, inspect monitors, and declare incidents.

**Set up in Datadog**

1. Prepare the Datadog account or service that the workflow will access. Grant access to the required resources and operations.
2. **Application Key or Access Token:** A Datadog Application Key, or a scoped Access Token (starts with 'ddpat\_'). Create one in Organization Settings -> Access Tokens (recommended) or Application Keys. Grant read scopes for metrics, logs, events, RUM, monitors, and users, plus incidents\_write if you will create incidents.
3. **Host Site:** The Datadog site hosting your organization. Identify it from your Datadog URL: app.datadoghq.com (US1), us3.datadoghq.com (US3), us5.datadoghq.com (US5), app.datadoghq.eu (EU1), ap1.datadoghq.com (AP1), app.ddog-gov.com (US1\_FED).

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Datadog**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field                   | Required                 | What to enter                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Application Key or Access Token | Yes                      | A Datadog Application Key, or a scoped Access Token (starts with 'ddpat\_'). Create one in Organization Settings -> Access Tokens (recommended) or Application Keys. Grant read scopes for metrics, logs, events, RUM, monitors, and users, plus incidents\_write if you will create incidents. [Provider instructions](https://docs.datadoghq.com/account_management/api-app-keys/). |
| API Key (Optional)              | Optional / as applicable | Your organization's Datadog API key (sent as the DD-API-KEY header). Not required for any of the current actions — only data-ingestion endpoints need it. Leave empty unless you know you need it. [Provider instructions](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys).                                                                                     |
| Host Site                       | Optional / as applicable | The Datadog site hosting your organization. Identify it from your Datadog URL: app.datadoghq.com (US1), us3.datadoghq.com (US3), us5.datadoghq.com (US5), app.datadoghq.eu (EU1), ap1.datadoghq.com (AP1), app.ddog-gov.com (US1\_FED).                                                                                                                                               |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Datadog** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Query Timeseries Metrics

Query timeseries metrics over a time window.

**Inputs**

| Field                     | Type     | Required | Description                                                     |
| ------------------------- | -------- | -------- | --------------------------------------------------------------- |
| Metrics Query             | string   | Yes      | Datadog metrics query to evaluate.                              |
| From                      | datetime | No       | Start of the query window. Defaults to one hour before the end. |
| To                        | datetime | No       | End of the query window. Defaults to now.                       |
| Rollup Interval (Seconds) | integer  | No       | Seconds between returned data points (optional).                |

**Outputs**

| Field           | Type    | Description                                           |
| --------------- | ------- | ----------------------------------------------------- |
| Times           | array   | Timestamps (epoch milliseconds) for each data point.  |
| Values          | array   | One array of data-point values per returned series.   |
| Series Metadata | array   | Metadata (group tags, unit) for each returned series. |
| Points Count    | integer | Number of data points returned per series.            |
| Result Message  | string  | Human-readable result summary.                        |

#### Search Logs

Search log events matching a query.

**Inputs**

| Field        | Type            | Required | Description                                                                                             |
| ------------ | --------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| Search Query | string          | No       | Datadog log search query. Use \* to match all logs. Default: \*.                                        |
| From         | string          | No       | Start of the search window (date math or ISO-8601). Default: now-15m.                                   |
| To           | string          | No       | End of the search window (date math or ISO-8601). Default: now.                                         |
| Indexes      | string          | No       | Comma-separated log index names to search (optional).                                                   |
| Limit        | integer         | No       | Maximum number of logs to return. Default: 25.                                                          |
| Sort         | select (string) | No       | Order of returned logs by timestamp. Available values: Newest first, Oldest first. Default: -timestamp. |
| Page Cursor  | string          | No       | Cursor from a previous search to fetch the next page.                                                   |

**Outputs**

| Field            | Type    | Description                                                  |
| ---------------- | ------- | ------------------------------------------------------------ |
| Logs             | array   | The matching log events.                                     |
| Count            | integer | Number of logs returned.                                     |
| Next Page Cursor | string  | Cursor for the next page; empty when there are no more logs. |
| Result Message   | string  | Human-readable result summary.                               |

#### Search Events

Search events matching a query.

**Inputs**

| Field        | Type            | Required | Description                                                                                               |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| Search Query | string          | No       | Datadog event search query. Use \* to match all events. Default: \*.                                      |
| From         | string          | No       | Start of the search window (date math or ISO-8601). Default: now-24h.                                     |
| To           | string          | No       | End of the search window (date math or ISO-8601). Default: now.                                           |
| Limit        | integer         | No       | Maximum number of events to return. Default: 25.                                                          |
| Sort         | select (string) | No       | Order of returned events by timestamp. Available values: Newest first, Oldest first. Default: -timestamp. |
| Page Cursor  | string          | No       | Cursor from a previous search to fetch the next page.                                                     |

**Outputs**

| Field            | Type    | Description                                                    |
| ---------------- | ------- | -------------------------------------------------------------- |
| Events           | array   | The matching events.                                           |
| Count            | integer | Number of events returned.                                     |
| Next Page Cursor | string  | Cursor for the next page; empty when there are no more events. |
| Result Message   | string  | Human-readable result summary.                                 |

#### Get Monitor

Retrieve a monitor's definition and current state.

**Inputs**

| Field   | Type            | Required | Description                                                                                   |
| ------- | --------------- | -------- | --------------------------------------------------------------------------------------------- |
| Monitor | select (string) | Yes      | Select a monitor, or type its numeric ID manually. Options load from the selected connection. |

**Outputs**

| Field          | Type   | Description                                              |
| -------------- | ------ | -------------------------------------------------------- |
| Monitor        | object | The monitor as returned by Datadog.                      |
| Monitor ID     | string | Numeric ID of the monitor.                               |
| Name           | string | Name of the monitor.                                     |
| Overall State  | string | Current state of the monitor (OK, Alert, Warn, No Data). |
| Result Message | string | Human-readable result summary.                           |

#### Create Incident

Declare a new incident.

**Inputs**

| Field                 | Type            | Required | Description                                                                                               |
| --------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| Title                 | string          | Yes      | Title of the incident to declare.                                                                         |
| Severity              | select (string) | No       | Severity of the incident. Available values: SEV-1, SEV-2, SEV-3, SEV-4, SEV-5, UNKNOWN. Default: UNKNOWN. |
| Customers Impacted    | boolean         | No       | Whether customers are impacted by this incident. Default: false.                                          |
| Customer Impact Scope | string          | No       | Description of the customer impact (optional).                                                            |

**Outputs**

| Field          | Type   | Description                                                |
| -------------- | ------ | ---------------------------------------------------------- |
| Incident       | object | The created incident.                                      |
| Incident ID    | string | Unique ID of the created incident.                         |
| Public ID      | string | Human-facing incident number (as shown in the Datadog UI). |
| Result Message | string | Human-readable result summary.                             |

#### Query RUM Events

Search individual Real User Monitoring events.

**Inputs**

| Field           | Type            | Required | Description                                                                                               |
| --------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| RUM Application | select (string) | No       | Scope to one RUM application. Select it, or type its ID. Options load from the selected connection.       |
| Search Query    | string          | No       | Datadog RUM search query. Use \* to match all events. Default: \*.                                        |
| From            | string          | No       | Start of the search window (date math or ISO-8601). Default: now-24h.                                     |
| To              | string          | No       | End of the search window (date math or ISO-8601). Default: now.                                           |
| Limit           | integer         | No       | Maximum number of RUM events to return. Default: 25.                                                      |
| Sort            | select (string) | No       | Order of returned events by timestamp. Available values: Newest first, Oldest first. Default: -timestamp. |
| Page Cursor     | string          | No       | Cursor from a previous search to fetch the next page.                                                     |

**Outputs**

| Field            | Type    | Description                                                    |
| ---------------- | ------- | -------------------------------------------------------------- |
| Events           | array   | The matching RUM events.                                       |
| Count            | integer | Number of RUM events returned.                                 |
| Next Page Cursor | string  | Cursor for the next page; empty when there are no more events. |
| Result Message   | string  | Human-readable result summary.                                 |

#### Aggregate RUM Events

Compute counts and percentiles over Real User Monitoring events.

**Inputs**

| Field                        | Type            | Required | Description                                                                                            |
| ---------------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| RUM Application              | select (string) | No       | Scope to one RUM application. Select it, or type its ID. Options load from the selected connection.    |
| Search Query                 | string          | No       | Datadog RUM query selecting the events to aggregate. Default: \*.                                      |
| From                         | string          | No       | Start of the aggregation window (date math or ISO-8601). Default: now-24h.                             |
| To                           | string          | No       | End of the aggregation window (date math or ISO-8601). Default: now.                                   |
| Computes                     | array           | Yes      | Up to 10 aggregations to compute. Each needs 'aggregation', plus 'metric' for everything except count. |
| Group By                     | array           | No       | Up to 5 RUM facets to split the results by. Default: \[].                                              |
| Group By Limit               | integer         | No       | Maximum number of buckets per grouping facet. Default: 10.                                             |
| Convert Durations To Seconds | boolean         | No       | Convert known RUM timing fields from nanoseconds to seconds. On by default. Default: true.             |

**Outputs**

| Field              | Type    | Description                                                  |
| ------------------ | ------- | ------------------------------------------------------------ |
| Buckets            | array   | One entry per returned bucket, with its grouping and values. |
| Computes           | object  | The computed values when there is exactly one bucket.        |
| Bucket Count       | integer | Number of buckets returned.                                  |
| Converted Computes | array   | Compute keys whose values were converted to seconds.         |
| Result Message     | string  | Human-readable result summary.                               |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/datadog.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
