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

# Let AI Agents Query Datadog Metrics and Monitors

> Let on-call agents query Datadog metrics, check monitors, and read incidents. The gateway injects your API and application keys so agents never see them.

> [!NOTE]
>
> Datadog is available on the Cloud plan only.

## Overview

Buckle connects AI agents to Datadog using an API key and application key. Agents can query metrics, list monitors, check incident status, and view dashboard data. The gateway injects both keys into requests to the Datadog API automatically.

This is useful for on-call agents that need to investigate incidents, coding agents that check deployment metrics, or reporting agents that pull monitoring data.

## What you will set up

* A Datadog API key and application key for your Datadog site
* Automatic injection of both keys on requests to the Datadog API
* Rules that inspect requests before they leave, plus per-agent access

## How it works

Buckle is two things in one: a **credential vault** and a **request gateway**.

When an agent makes a request to Datadog, it flows through Buckle's gateway. At request time, two things happen:

1. **Secret injection**: Buckle injects the API key and application key into the outgoing request. The agent itself never sees the raw credentials.
2. **Request inspection**: Buckle evaluates the request against your [rules](/docs/guides/rules.md) before it leaves. If the request violates a policy (e.g., an agent tries to send a sensitive identifier to Datadog, or attempts a write operation you haven't allowed), Buckle blocks it. The request never reaches Datadog.

This means Buckle protects more than just the API key. It controls what data the agent can read and write through the Datadog API.

### Direct API, not MCP

The Datadog integration goes through the Datadog API directly, using [Datadog's agent skills](https://github.com/datadog-labs/agent-skills). There is no MCP server in the middle. Your agent calls the Datadog API, and Buckle's gateway intercepts the request, applies your rules, injects the credentials, and forwards it. This gives you full visibility and control over every request.

> [!NOTE]
>
> For a deeper look at the gateway architecture, see [How it works](/docs/how-it-works.md#architecture-overview).

## Prerequisites

Before connecting Datadog to Buckle, you need three things from your Datadog account:

| Credential | What it is | Where to find it |
| - | - | - |
| **API Key** | Authenticates requests to the Datadog API | **Organization Settings** > **API Keys** |
| **Application Key** | Scopes access to specific Datadog features | **Organization Settings** > **Application Keys** |
| **Datadog Site** | The regional site for your account (e.g., `us1`, `us3`, `us5`, `eu`, `ap1`) | Check your browser URL bar; the subdomain before `.datadoghq.com` is your site |

### Getting your API key

1. Log in to [Datadog](https://app.datadoghq.com).
2. Go to **Organization Settings** > **API Keys** (or navigate to `https://app.datadoghq.com/organization-settings/api-keys`).
3. Click **+ New Key**, give it a name like `Buckle`, and click **Create Key**.
4. Copy the key immediately. Datadog only shows it once.

### Getting your application key

1. In Datadog, go to **Organization Settings** > **Application Keys** (or navigate to `https://app.datadoghq.com/organization-settings/application-keys`).
2. Click **+ New Key**, name it `Buckle`, and click **Create Key**.
3. Copy the key immediately.

> [!TIP]
>
> Create dedicated keys for Buckle rather than reusing existing ones. This makes it easy to rotate or revoke access later without affecting other integrations.

### Finding your Datadog site

Your Datadog site depends on the region you selected when you created your account. Check the URL you use to log in:

| Login URL | Site value |
| - | - |
| `app.datadoghq.com` | `us1` |
| `us3.datadoghq.com` | `us3` |
| `us5.datadoghq.com` | `us5` |
| `app.datadoghq.eu` | `eu` |
| `ap1.datadoghq.com` | `ap1` |

## Setup

**1. Open the app**

Open the Buckle dashboard and navigate to **Settings** > **Apps** > **Datadog**.

**2. Enter your credentials**

Click **Connect Datadog**. In the connection dialog, enter your **Application Key**, **API Key**, and **Datadog Site**, then click **Connect Datadog**.

![Buckle connect window for Datadog, showing the setup guide link and the fields to fill in.](https://mintcdn.com/onecli-17d3f772/hJP3XqgFsBDnXHKy/images/integrations/datadog/buckle-connect-datadog.png?fit=max\&auto=format\&n=hJP3XqgFsBDnXHKy\&q=85\&s=e9cfb4860d83c7ea7b5862ec60e3c4c6)

The Datadog connect window in Buckle.

**3. Verify**

After connecting, the Datadog connection will show as **Connected** in your dashboard. Buckle stores your keys encrypted and injects them into agent requests through the gateway. Your keys are never exposed to the agent itself.

## What agents can do

* Query time-series metrics with custom queries and time ranges
* List monitors and their current statuses (OK, Alert, Warn, No Data)
* Get details for a specific monitor, including recent state changes
* List active incidents and their severity, timeline, and postmortem status
* Query dashboard widget data
* Search and read log entries
* List hosts and their tags
* Query infrastructure metrics (CPU, memory, disk, network)
* Check SLO (Service Level Objective) status and error budgets
* Read and create events

## Controlling access

Access is per agent: [grant](/docs/guides/agent-access.md) the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked — a read-only agent is a single grant. Organization [rules](/docs/guides/rules.md) add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Datadog.

## FAQ

> [accordion] How do I rotate my Datadog keys?
>
> Create a new API key or application key in **Organization Settings**, then update it in **Settings** > **Apps** > **Datadog**. Agents pick up the new keys automatically. Then revoke the old key in Datadog.

> [accordion] How do I keep Datadog keys out of the agent's context?
>
> Store them in Buckle instead of `DD_API_KEY` and `DD_APP_KEY`. The gateway injects both keys at the proxy, so the agent never holds them. See [How it works](/docs/how-it-works.md).

> [accordion] Does this use a Datadog MCP server?
>
> No. The integration calls the Datadog API directly, using Datadog's agent skills, with no MCP server in the middle.

> [accordion] Can I block agents from writing to Datadog?
>
> Yes. Allow only read tools when you [grant](/docs/guides/agent-access.md) the connection, and add [rules](/docs/guides/rules.md) to block write operations.


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