Agent Console のセットアップ

This product is not supported for your selected Datadog site. ().
プレビュー

Agent Console はプレビュー中で、Datadog のお客様すべてにご利用いただけます。

Agent Console で監視したい各コーディングエージェントのインテグレーションをセットアップします。

Claude Code

Agent Console で Claude Code を監視するには、Anthropic 使用状況とコストインテグレーションをセットアップします。

セットアップ後、Agent Console に移動し、Claude Code タイルをクリックすると、メトリクスが表示されます。

オプション 2: OpenTelemetry (OTLP)

以下の手順では、OpenTelemetry プロトコル (OTLP) を使用して Datadog に直接テレメトリを送信するように Claude Code を設定します。

  1. ログ構成にすべてをキャッチするインデックス、または service:claude-code をカバーするインデックスが含まれていることを確認してください。

  2. Datadog API キーを生成します。

  3. Claude Code 設定ファイル (例: ~/.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": "",
        "OTEL_METRICS_EXPORTER": "otlp",
        "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "http/protobuf",
        "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": "",
        "OTEL_EXPORTER_OTLP_HEADERS": "dd-api-key=<DATADOG_API_KEY>"
      }
    }
    

    Replace <DATADOG_API_KEY> with your Datadog API key.

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

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

Option 3: Forward data through the Datadog Agent

  1. Make sure 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. Claude Code 設定ファイル (例: ~/.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"
      }
    }
    
    組織全体で Claude Code のための Agent Console をセットアップするには、IT チームがモバイルデバイス管理 (MDM) システムまたは サーバー管理設定を使用して、すべての管理デバイスに Claude Code 設定ファイルを配布できます。
  5. Claude Code を再起動します。

Claude Code を再起動した後、Agent Consoleに移動し、Claude Code タイルをクリックします。数分以内にメトリクス (使用状況、コスト、レイテンシー、エラー) が表示されるはずです。

Cursor

Cursor を Agent Console で監視するには、Datadog Extension for Cursor を使用して Cursor インテグレーションをセットアップします。

セットアップ後、Agent Console に移動し、Cursor タイルをクリックすると、メトリクスが表示されます。

GitHub Copilot

GitHub Copilot を Agent Console で監視するには、GitHub Copilot のインテグレーションをセットアップします。

セットアップ後、Agent Console に移動し、GitHub Copilot タイルをクリックすると、メトリクスが表示されます。

参考資料