AI Agents Console

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Join the Preview!

AI Agents Console is in Preview. Complete the form to request access.

Request Access

Datadog’s AI Agents Console provides monitoring for agentic tools like Claude Code, enabling you to collect logs and metrics from developer environments and view them in real time within Datadog.

Set up AI Agents Console for Claude Code

The following procedure configures Claude Code to send telemetry directly to Datadog with the OpenTelemetry protocol (OTLP). To send telemetry through the Datadog Agent instead, see Forward data through the Datadog Agent.

  1. Ensure that your Logs configuration includes a catch-all index, or an index that covers service:claude-code.

  2. Generate a Datadog API key.

  3. Set the following environment variables in your Claude Code settings file (for example, ~/.claude/settings.json):

    {
      "env": {
        "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
        "OTEL_LOGS_EXPORTER": "otlp",
        "OTEL_EXPORTER_OTLP_LOGS_PROTOCOL": "http/protobuf",
        "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "/v1/logs",
        "OTEL_EXPORTER_OTLP_HEADERS": "dd-api-key=<DATADOG_API_KEY>",
        "OTEL_METRICS_EXPORTER": "otlp",
        "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "http/protobuf",
        "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": ""
      }
    }
    

    Replace <DATADOG_API_KEY> with your Datadog API key.

    To set up AI Agents Console for Claude Code across your organization, your IT team can use a Mobile Device Management (MDM) system to distribute the Claude Code settings file across all managed devices.
  4. Restart Claude Code.

  1. Ensure that your Logs configuration includes a catch-all index, or an index that covers service:claude-code.

  2. Install the Datadog Agent.

  3. Configure your Datadog Agent to enable the OpenTelemetry Collector:

    otlp_config:
      receiver:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
      logs:
        enabled: true
    otelCollector:
      enabled: true
    
  4. Set the following environment variables in your Claude Code settings file (for example, ~/.claude/settings.json):

    { 
      "env": { 
        "CLAUDE_CODE_ENABLE_TELEMETRY": "1", 
        "OTEL_METRICS_EXPORTER": "otlp", 
        "OTEL_LOGS_EXPORTER": "otlp", 
        "OTEL_EXPORTER_OTLP_ENDPOINT": "http://127.0.0.1:4317", 
        "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc", 
        "OTEL_METRIC_EXPORT_INTERVAL": "10000" 
      }
    } 
    
    To set up AI Agents Console for Claude Code across your organization, your IT team can use a Mobile Device Management (MDM) system to distribute the Claude Code settings file across all managed devices.
  5. Restart Claude Code.

Verification

After you restart Claude Code, navigate to the AI Agents Console in Datadog and click on the Claude Code tile. Metrics (usage, cost, latency, errors) should appear within a few minutes.

Further reading

Documentation, liens et articles supplémentaires utiles: