> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traversal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Datadog

> Connect Datadog to pull metrics, logs, traces, RUM, alerts, and events during investigations.

Connecting Datadog lets Traversal use your logs, metrics, traces, Real User Monitoring (RUM), and monitors during investigations.

## What Traversal reads

* **Logs**: queried from your log indexes
* **Metrics**: time-series data and tag metadata
* **Spans and traces**: APM span data
* **Real User Monitoring**: sessions, views, actions, errors, resources, and long tasks
* **Incidents**: active and historical incident records
* **Events**: event stream data
* **Monitors**: monitor state and alert history
* **Dashboards**: dashboard panel definitions

## Setup

**1. Create an API key**

The API key identifies your Datadog organization. In Datadog, go to:

**Organization Settings** → **API Keys** → **New Key**

Name it (for example, `traversal`) and copy the value. Datadog doesn't show it again.

**2. Create an Application key**

The application key authorizes API queries on behalf of a user. Go to:

**Organization Settings** → **Application Keys** → **New Key**

Name it (for example, `traversal`) and copy the value. Datadog doesn't show it again.

> [tab] Unscoped key (simpler)
>
> Create the application key under a **dedicated read-only Datadog user**.
>
> The key inherits that user's permissions, so you don't need explicit scopes. Traversal has read-only access to everything that user can see.
>
> > [!NOTE]
> >
> > Recommended for most setups. Create a service user with the **Datadog Read Only Role** and generate the application key under that account.

> [tab] Scoped key (more restrictive)
>
> Create the application key under any user and add the following scopes explicitly:
>
> | Scope | What it covers |
> | - | - |
> | `logs_read_data` | Log queries |
> | `metrics_read` | Metric tag configuration and metadata |
> | `timeseries_query` | Metric time-series data |
> | `apm_read` | Spans and traces |
> | `rum_apps_read` | RUM events and aggregate analytics |
> | `incident_read` | Incident records |
> | `events_read` | Event stream |
> | `monitors_read` | Monitor state and alerts |
> | `dashboards_read` | Dashboard definitions |
>
> > [!WARNING]
> >
> > `metrics_read` alone is **not** sufficient for metric queries. It only grants access to metric names, metadata, and tag configurations. You must also add `timeseries_query` to allow Traversal to read actual metric values.
>
> > [!NOTE]
> >
> > Use this if your security policy requires explicit permission grants, or if the creating user has broader access you don't want to expose.

**3. Find your API URL**

Your API URL is based on your Datadog site. To find it, look at your browser URL when logged in to Datadog and match it below:

| Browser URL | API URL to use |
| - | - |
| `app.datadoghq.com` | `https://api.datadoghq.com` |
| `us3.datadoghq.com` | `https://api.us3.datadoghq.com` |
| `us5.datadoghq.com` | `https://api.us5.datadoghq.com` |
| `app.datadoghq.eu` | `https://api.datadoghq.eu` |
| `ap1.datadoghq.com` | `https://api.ap1.datadoghq.com` |
| `ap2.datadoghq.com` | `https://api.ap2.datadoghq.com` |
| `app.ddog-gov.com` | `https://api.ddog-gov.com` |

**4. Configure in Traversal**

Go to **Integrations**, select **Datadog**, and enter:

* Datadog API URL
* API key
* Application key

> [!NOTE]
>
> Datadog RUM is available to organizations with RUM access enabled in Traversal. Contact your Traversal representative to enable it.

## Use Datadog during investigations

### Logs

Find errors and operational messages, compare patterns across services or environments, and inspect the context around a failure.

* `Find error and critical logs from the checkout service during the incident.`
* `Compare database timeout logs before and after the deployment.`

### Metrics

Identify anomalous time series, correlate infrastructure and application behavior, and check whether a mitigation restored normal behavior.

* `Graph request latency, error rate, and throughput for checkout during the incident.`
* `Which Kubernetes resource metrics changed most when the failures began?`

### Spans and traces

Find slow or failed requests, follow a request across services, or inspect a specific trace ID.

* `Find an anomalous error trace for the checkout service during the incident.`
* `Inspect trace 1234567890 and identify the slowest or failing span.`

### Real User Monitoring

Measure affected sessions or users, isolate frontend regressions by route or cohort, and compare page performance across releases.

* `Which routes had the most affected sessions? Exclude synthetic traffic.`
* `Compare checkout errors by application version and browser, then inspect examples from the worst cohort.`

> [!NOTE]
>
> Traversal sends only investigation-relevant RUM fields to the agent and doesn't retrieve Session Replay recordings.
>
> * Coverage depends on where you installed the Datadog Browser SDK, and on your Datadog sampling, retention filters, and RUM retention window.
> * Event types can have different sampling rates. Prefer affected-session or affected-user counts, compared with a relevant total population.
> * A zero-result query does not prove that no customers were affected.
> * Frontend-to-backend correlation requires Datadog RUM/APM correlation fields.

### Incidents

Review active and historical incident records, their status and severity, and prior response context.

* `Show Datadog incidents related to checkout failures in the last 30 days.`
* `Summarize the timeline and current status of the active payments incident.`

### Events

Find monitor firings, deployments, configuration changes, feature flag changes, and Kubernetes events around an incident.

* `Which high-priority monitors fired when the incident began?`
* `Find deployments and configuration changes for checkout in the hour before the errors started.`

### Monitors

Inspect alert definitions, queries, thresholds, options, and runbook messages, or find monitors by state, service, team, or tag.

* `Show the query and thresholds for Datadog monitor 12345.`
* `Find alerting monitors for checkout in production and summarize their current states.`

### Dashboards

Discover the signals your team already watches, inspect panel queries, and use them as starting points for deeper analysis.

* `Find the checkout overview dashboard and explain which panels changed during the incident.`
* `Use the latency panel query from the payments dashboard to compare the affected and healthy periods.`

## More information

* [Datadog API and Application keys](https://docs.datadoghq.com/account_management/api-app-keys/)
* [Datadog OAuth scopes](https://docs.datadoghq.com/api/latest/scopes/)
* [Datadog site URLs](https://docs.datadoghq.com/getting_started/site/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.