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

# Datadog Integration

> Monitor and analyze metrics, logs, events, and alerts from Datadog with Aurora's AI-powered incident management

Integrate Aurora with Datadog to automatically track alerts, query metrics and logs, and perform root cause analysis on monitoring data.

## Authentication

Datadog uses **API Key + Application Key** authentication.

### Prerequisites

* A Datadog account (US1, US3, US5, EU, AP1, AP2, or Gov)
* Organization admin access to create API keys

### Setup Steps

<Steps>
  <Step title="Create API Key">
    1. Go to [Datadog](https://app.datadoghq.com/) and click your avatar
    2. Navigate to **Organization Settings** > **API Keys**
    3. Click **+ New Key**
    4. Name it `Aurora` and copy the generated key
  </Step>

  <Step title="Create Application Key">
    1. In **Organization Settings**, go to **Application Keys**
    2. Click **+ New Key**
    3. Name it `Aurora` and copy the generated key
  </Step>

  <Step title="Identify Your Site">
    Determine which Datadog site you're using:

    | Site | URL                 |
    | ---- | ------------------- |
    | US1  | `datadoghq.com`     |
    | US3  | `us3.datadoghq.com` |
    | US5  | `us5.datadoghq.com` |
    | EU   | `datadoghq.eu`      |
    | AP1  | `ap1.datadoghq.com` |
    | AP2  | `ap2.datadoghq.com` |
    | Gov  | `ddog-gov.com`      |
  </Step>

  <Step title="Connect to Aurora">
    1. In Aurora, navigate to **Integrations** > **Datadog**
    2. Enter your API Key, Application Key, and site
    3. Click **Connect**
  </Step>
</Steps>

## Configuration

No environment variables are required. API keys are entered through the Aurora UI and stored securely in Vault.

## Webhook Setup (Optional)

To receive real-time alerts from Datadog monitors:

<Steps>
  <Step title="Get Webhook URL">
    In Aurora's Datadog integration page, copy your unique webhook URL:

    ```
    https://your-aurora-domain/datadog/webhook/{user_id}
    ```
  </Step>

  <Step title="Configure Webhook in Datadog">
    1. In Datadog, go to **Integrations** > **Webhooks**
    2. Click **+ New**
    3. Name it `aurora`
    4. Paste your Aurora webhook URL
    5. Save the webhook
  </Step>

  <Step title="Add to Monitors">
    In any Datadog monitor notification, add `@webhook-aurora` to automatically send alerts to Aurora.
  </Step>
</Steps>

### Development with ngrok

For local development, webhooks cannot reach `localhost:5080` directly. Set up port forwarding:

```bash .env theme={null}
NGROK_URL=https://your-ngrok-url.ngrok-free.app
```

Start ngrok:

```bash theme={null}
ngrok http 5080
```

## What Aurora Can Query

Once connected, Aurora can:

### Logs

* Search logs with Datadog query syntax
* Filter by time range, sources, tags
* Access structured log attributes
* Retrieve up to 500 logs per query

**API Endpoint:** `POST /datadog/logs/search`

**Example Query:**

```json theme={null}
{
  "query": "service:web-app status:error",
  "from": "2026-03-03T10:00:00Z",
  "to": "2026-03-03T11:00:00Z",
  "limit": 50
}
```

### Metrics

* Query timeseries metrics
* Aggregate by tags and dimensions
* Define custom time ranges and intervals
* Use Datadog metric query language

**API Endpoint:** `POST /datadog/metrics/query`

**Example Query:**

```json theme={null}
{
  "query": "avg:system.cpu.user{*} by {host}",
  "fromMs": 1709463600000,
  "toMs": 1709467200000,
  "interval": 60
}
```

### Events

* List Datadog events by time range
* Filter by priority, sources, tags
* Access event metadata and context

**API Endpoint:** `GET /datadog/events`

**Parameters:**

* `start` - Unix timestamp (default: 1 hour ago)
* `end` - Unix timestamp (default: now)
* `priority` - Filter by priority level
* `sources` - Comma-separated source names
* `tags` - Comma-separated tags

### Monitors

* List all monitors with pagination
* Filter by name, tags, status
* View monitor state and downtime info
* Access group states

**API Endpoint:** `GET /datadog/monitors`

**Parameters:**

* `page` - Page number (default: 0)
* `page_size` - Results per page (max: 100)
* `name` - Filter by monitor name
* `tags` - Filter by monitor tags
* `status` - Filter by status (Alert, Warn, OK, etc.)
* `group_states` - Filter by group state (default: all)
* `with_downtimes` - Include downtime info (default: true)

### Webhook Events

* Receive real-time monitor alerts
* Auto-create incidents from triggers
* Correlate related alerts
* Generate AI-powered root cause analysis

**Ingested Data:**

* Event type and title
* Monitor status (alert, warn, resolved)
* Scope and tags
* Metrics and queries
* Snapshots and links

## Troubleshooting

**Connection Failed**

* Verify API Key and Application Key are correct
* Ensure keys have not been revoked
* Check that you selected the correct site/region

**Webhook Not Receiving Events**

* Verify `NGROK_URL` is set correctly (for local development)
* Ensure ngrok tunnel is running
* Check webhook is configured in Datadog with correct URL
* Send a test notification from Datadog webhook settings

**Rate Limit Errors**

* Datadog API rate limits apply per organization
* Reduce query frequency or use longer time windows
* Check Datadog API usage in your account settings

## API Reference

**Base Path:** `/datadog`

| Method | Endpoint             | Description               |
| ------ | -------------------- | ------------------------- |
| POST   | `/connect`           | Connect Datadog account   |
| GET    | `/status`            | Check connection status   |
| DELETE | `/disconnect`        | Remove Datadog connection |
| POST   | `/logs/search`       | Search logs               |
| POST   | `/metrics/query`     | Query metrics             |
| GET    | `/events`            | List events               |
| GET    | `/monitors`          | List monitors             |
| GET    | `/events/ingested`   | View webhook events       |
| POST   | `/webhook/{user_id}` | Receive webhooks          |
| GET    | `/webhook-url`       | Get webhook URL           |

For detailed information, see the [Datadog API documentation](https://docs.datadoghq.com/api/latest/).
