Loading...
    • ビルド
    • 管理
    • モデルと料金
    • クライアントSDK
    • APIリファレンス
    Search...
    ⌘K
    管理
    Admin API概要ワークスペースデータレジデンシーAPIとデータ保持
    モニタリング
    Claude Code Analytics API使用量とコストAPI
    サードパーティプラットフォーム
    Amazon BedrockMicrosoft FoundryVertex AI
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    モニタリング

    セッショントレーシング

    Console のタイムラインとローイベントビューを使用してセッションを監視・デバッグします。

    Was this page helpful?

    • Console のオブザーバビリティ

    Claude Managed Agents は、エージェントセッションの監視、デバッグ、理解を支援するオブザーバビリティツールを Claude Console で提供しています。

    Console のオブザーバビリティ

    Console はエージェントセッションのビジュアルタイムラインビューを提供します。Console の Claude Managed Agents セクションに移動すると、以下を確認できます:

    • セッションリスト - すべてのセッションとそのステータス、作成時刻、モデル
    • トレーシングビュー - セッション内のイベント(コンテンツ、タイムスタンプ、トークン使用量)の時系列ビュー。これらは開発者と管理者のみがアクセスできます。
    • ツール実行 - 各ツール呼び出しとその結果の詳細

    ローイベント

    プログラムによるデバッグのために、API 経由でローイベントを取得します:

    curl -fsSL "https://api.anthropic.com/v1/sessions/$SESSION_ID/events" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
    | jq -r '
      .data[]
      | "Type: \(.type)",
        "Processed: \(.processed_at)",
        ( if .type | IN("user.message", "agent.message") then
            .content[]
            | "  Block: \(.type)",
              (select(.type == "text") | "  Text: \(.text[:100])...")
          elif .type | IN("agent.tool_use", "agent.custom_tool_use", "agent.mcp_tool_use") then
            "  Tool: \(.name)"
          else empty end ),
        "---"
    '

    同じイベントストリームを使用してエラーを表示し、トークン消費量を追跡します:

    デバッグのヒント

    • セッションイベントを確認する - セッションエラーは session.error イベントを通じて伝達されます
    • ツール結果を確認する - ツール実行の失敗は、予期しないエージェントの動作を説明することが多いです
    • トークン使用量を追跡する - トークン消費量を監視してプロンプトを最適化し、コストを削減します
    • システムプロンプトを使用する - システムプロンプトにログ記録の指示を追加して、エージェントが推論を説明できるようにします
    curl -fsSL "https://api.anthropic.com/v1/sessions/$SESSION_ID/events" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
    | jq -r '
      (.data[] | select(.type == "session.error") | "[\(.error.type)] \(.error.message)"),
      (reduce (.data[] | select(.type == "span.model_request_end") | .model_usage) as $u
         ({input: 0, output: 0}; .input += $u.input_tokens | .output += $u.output_tokens)
       | "Total input tokens: \(.input), output tokens: \(.output)")
    '