For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/real_user_monitoring/application_monitoring/agentic_onboarding.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Set up RUM with an agent

Copy this prompt into your AI coding agent to use the dd-orchestrator skill for guided RUM setup.
Using skill at https://github.com/datadog-labs/agent-skills/blob/main/dd-orchestrator/SKILL.md setup Datadog RUM in my project

Overview

Agentic Onboarding is a set of AI-driven tools that automate Datadog instrumentation for your applications and infrastructure:

  • AI Setup CLI: Set up Datadog from a terminal, without a coding assistant.
  • MCP server: Set up Datadog through a coding assistant (such as Claude Code or Cursor), which handles framework detection and configuration from your IDE.

The two paths are complementary and use the same Datadog account. You can install the Datadog MCP Server in your IDE and run the CLI in a terminal.

AI Setup CLI

The Datadog AI Setup CLI is a standalone terminal tool. Use it when you don’t want to install an MCP server, or for tasks the MCP setup doesn’t support, such as creating a Datadog account.

The CLI can:

  • Create a Datadog account end-to-end from the terminal
  • Link an existing Datadog account to your local environment
  • Instrument local infrastructure as code (Terraform, Helm, Kustomize, Ansible, Pulumi, raw Kubernetes manifests, Docker Compose files) by editing files in place
  • Instrument local application code by adding SDK initialization and configuration for supported frontends and backends

Prerequisites

  • Node.js 22 or later

Supported products

The CLI can set up the following products:

ProductIdentifier
App and API Protectionapp_and_api_protection
Code Coverageci_code_coverage
Dockerdocker
Error Trackingerror-tracking
Infrastructure Monitoringinfra-monitoring
Linuxlinux
Agent Observabilityllm-obs
OpenTelemetryotel
Product Analyticsproduct-analytics
Real User Monitoring (RUM)rum
Serverless Monitoringserverless
Studiostudio
Test Optimizationtest-optimization

Install and run the CLI

Run the CLI with npx, passing --site to target your Datadog site (). You have two options, depending on whether you already have a Datadog account:

  1. Use this option if you don’t have a Datadog account, or if you want the CLI to recommend products based on your code analysis. The CLI steps you through account setup, repository analysis, and product recommendations.

    npx @datadog/ai-setup-cli --site datadoghq.com
    

    Replace the value of --site with the Datadog site for your account: ().

  2. Press Enter at the welcome screen and choose whether you have a Datadog account. A browser opens for OAuth (or for account creation if you don’t have an account yet). Complete the flow and grant access to your Datadog account.

  3. Enter the path to the repository you want to instrument.

  4. With your consent, the CLI analyzes the repository in read-only mode to detect your stack.

  5. Based on the detected stack, the CLI recommends up to three supported Datadog products. Recommendations are selected by default. Deselect individual recommendations, confirm the selection, or choose View all setup options to use the full list of setup options instead.

  1. Use this option if you already have a Datadog account and know which product you want to install. Add the --product flag to go straight to setup and skip repository analysis and product recommendations.

    npx @datadog/ai-setup-cli --site datadoghq.com --product <PRODUCT>
    
    • Replace the value of --site with the Datadog site for your account: ().
    • Replace <PRODUCT> with one of the products listed in the Supported products section.
  2. Press Enter at the welcome screen and choose whether you have a Datadog account. A browser opens for OAuth (or for account creation if you don’t have an account yet). Complete the flow and grant access to your Datadog account.

Configure and verify your setup

  1. If the CLI can’t generate recommendations, or doesn’t find a strong match for your repository, it directs you to the full list of setup options. For direct setup with --product, you start at this menu.

    CLI menu 'What would you like to set up?' grouped by Infrastructure and Backend monitoring, Frontend Monitoring, LLM-Based applications, and CI Testing.

  2. The CLI detects your project’s frameworks, applies the required configuration, and provisions any necessary environment variables. Progress is reported stage by stage.

    CLI showing 'Instrumenting your app, Stage 1 of 3: Datadog RUM (Real User Monitoring)' with progress steps.

  3. When setup completes, the CLI lists the products it instrumented and links to the Datadog UI to verify incoming data.

  4. Commit the changes to your repository. You can edit the Datadog environment variables (API keys, application IDs) for your specific environment.

After the CLI completes, see the Next steps section to confirm data is flowing.

Headless mode

Headless mode is designed for unattended setups. An AI coding agent, CI job, or script can run the CLI directly in your repository and complete Datadog instrumentation on its own. No person needs to be present to approve prompts or make interactive choices.

Use --headless to skip the interactive UI. It requires both --site and --product:

DD_API_KEY=<API_KEY> DD_APP_KEY=<APP_KEY> \
  npx @datadog/ai-setup-cli \
  --headless \
  --site datadoghq.com \
  --product rum

Set the DD_API_KEY and DD_APP_KEY environment variables to authenticate without user interaction. Provide both variables together.

Alternatively, omit the API and application keys to authenticate with browser OAuth. OAuth is the only part of a headless run that might require user interaction, and it requires a localhost callback. For remote or fully unattended environments, use the DD_API_KEY and DD_APP_KEY environment variables instead.

By using --headless, you confirm that source-code upload and automatic command execution are authorized for the target project.

MCP Server

The Datadog MCP Server exposes the onboarding toolset to any MCP-compatible coding assistant. After you install and authenticate the server, you instrument a project by typing a one-line prompt. The agent reads your code, calls MCP tools (with your permission), applies changes, and verifies the result.

Prerequisites

Supported frameworks

ProductFrameworks
Error Tracking, RUM, Product AnalyticsAndroid, Angular, iOS, Next.js, React, Svelte, Vanilla JS, Vue
Kubernetes ObservabilityHelm, Kustomize, raw manifests, Terraform, Pulumi, Ansible (across GKE, EKS, AKS, minikube, and others such as kind, k3s, and OpenShift)
Docker Observabilitydocker-compose and sidecar (docker run) deployments; Terraform, Ansible, and other IaC (Pulumi, CloudFormation, Puppet, Chef)
Linux ObservabilityTerraform, Ansible, other IaC (Pulumi, CloudFormation, Puppet, Chef), and plain-shell install
Serverless Monitoring (AWS Lambda)AWS SAM, AWS CDK, Serverless Framework, Terraform, datadog-ci lambda instrument
Serverless Monitoring (GCP Cloud Run and Cloud Run Functions)Terraform, gcloud run deploy, Cloud Run YAML, Dockerfile, Gen 2 gcloud functions deploy
Serverless Monitoring (Azure Container Apps)Terraform, Bicep, ARM template, azure.yaml (azd), az containerapp CLI
Agent ObservabilityOpenAI, Anthropic, LangChain, Vercel AI SDK (auto-detected from project dependencies)
OpenTelemetryNode.js / server-side TS, Browser JS / React / Vite, Python (Django, Flask, FastAPI), Java, Go
App and API ProtectionPython, Node.js, Java, Go, Ruby, .NET, PHP, and proxies (Envoy, HAProxy) for Linux, Windows, Kubernetes, Docker, GCP Cloud Run, and AWS Lambda, AWS Fargate/ECS
Code Coverage, Test OptimizationJest, Vitest, Mocha, Playwright, Cypress, pytest, unittest, JUnit, TestNG, RSpec, minitest, xUnit, NUnit, MSTest v2, go test, XCTest / Swift Testing

Step 1: Install the MCP Server

In an active Claude Code session, run:

claude mcp add --transport http datadog-onboarding- "?toolsets=onboarding"

Option 1: Install deeplink (recommended)

Click the install deeplink for your Datadog site, then confirm Install for the datadog-onboarding-<span class="js-region-param region-param" data-region-param="dd_datacenter_lowercase"></span> server when Cursor opens.

Option 2: Manual configuration

Add the server to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "datadog-onboarding-": {
      "url": "?toolsets=onboarding"
    }
  }
}

Any MCP client that supports HTTP transport can connect to the Datadog MCP Server. Point it at the endpoint for your Datadog site:

?toolsets=onboarding

Step 2: Authenticate the MCP Server

  1. After you install the MCP Server, your coding assistant prompts you to authenticate. Press Enter to open the Datadog OAuth screen in your browser.
  2. After authentication completes, choose Open to return to your IDE and grant the MCP Server access to your Datadog account.
  3. Confirm that MCP tools appear under the datadog-onboarding- server.

Step 3: Instrument your project

Send the prompt that matches the product you want to set up:

Add Datadog Error Tracking to my project
Add Datadog Real User Monitoring to my project
Add Datadog Product Analytics to my project

Kubernetes

Add Datadog for Kubernetes to my project

Docker

Add Datadog for Docker to my project
Add Datadog App and API Protection to my project

AWS Lambda

Add Datadog for AWS Lambda to my project
npx @datadog/ai-setup-cli --product serverless --serverless-compute-type=aws-lambda

GCP Cloud Run containers

Add Datadog for GCP Cloud Run containers to my project
npx @datadog/ai-setup-cli --product serverless --serverless-compute-type=gcp-cloud-run

GCP Cloud Run functions

Add Datadog for GCP Cloud Run functions to my project
npx @datadog/ai-setup-cli --product serverless --serverless-compute-type=gcp-cloud-run-functions

Azure Container Apps

Add Datadog for Azure Container Apps to my project
npx @datadog/ai-setup-cli --product serverless --serverless-compute-type=azure-container-apps

The agent detects your stack, requests permission before each tool call, applies changes locally (without committing them), and prints verification steps.

After the agent completes, commit the changes to your repository and set any new environment variables (API keys, application IDs) in your production environment. Then see the Next steps section to confirm data is flowing.

Next steps

Confirm data is flowing in the Datadog UI for the product you set up:

Further reading

Additional helpful documentation, links, and articles: