> This page is for version v1.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.paid.ai/v-2/llms.txt
> - v1: https://docs.paid.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paid.ai/_mcp/server.

# Datadog Integration

> Import OpenTelemetry spans from Datadog for usage-based billing.

Import OpenTelemetry spans from your Datadog account into Paid for retroactive billing or to leverage existing instrumentation without modifying your application code.

## Prerequisites

* **Datadog API key**: Found in Organization Settings → API Keys
* **Datadog App key**: Found in Personal Settings → Application Keys
* A Paid product and customer to associate imported spans with
* Admin access to Paid's integration settings

## Setup

### 1. Add Datadog Credentials

Navigate to **Settings → Integrations → Datadog** and configure your credentials:

![Datadog integration setup](/_fern-img/8584aa9a069628a1f35bf02464e6a3f08cf43419542bc865023ad12f9b798739.webp)

* **Name**: Descriptive identifier (e.g., `datadog-prod`). Must contain only alphanumeric characters or `-/_+=@!`
* **Description**: Optional notes to identify this key pair
* **Datadog API key**: Your organization API key
* **Datadog App key**: Your application key

Multiple credential sets can be added for different environments.

### 2. Import Spans

Navigate to **Events** and click **Import from Datadog**:

![Import spans from Datadog](/_fern-img/0627594815976067830ac7483d59c27b57160d4a609b7bf39d33f16bdb5693d6.webp)

Configure your import:

* **Query**: Datadog span query (e.g., `@otel.library.name:ai`)
* **Date range**: Time period to import from
* **Product**: Product to associate spans with
* **Customer**: Customer to bill for these spans
* **Datadog credentials**: Credential set to use
* **Limit**: Maximum spans to import (1-10,000)

Click **Preview** to verify results before importing.

## Query Examples

| Query                   | Description                      |
| ----------------------- | -------------------------------- |
| `@otel.library.name:ai` | AI library spans                 |
| `service:my-ai-service` | Specific service                 |
| `@http.status_code:200` | Successful HTTP requests         |
| `resource_name:openai*` | Resources starting with "openai" |
| `env:production`        | Production environment only      |