Skip to content

Auto-instrumentation emits less detailed Claude Agent SDK traces than wrapper instrumentation #1593

@lforst

Description

@lforst

Summary

Claude Agent SDK auto-instrumentation currently captures a shallower trace shape than the wrapper path.

What differs

The wrapper path emits richer semantic spans for tool calls and nested subagent work, while the auto-instrumented path mainly captures the top-level query(...) / agent span and related LLM activity.

Why this matters

Users get materially different trace detail depending on whether they use wrappers or auto-instrumentation. It also prevents full parity in the shared e2e trace contract.

Repro

The aligned e2e coverage in:

  • e2e/scenarios/wrap-claude-agent-sdk-traces
  • e2e/scenarios/claude-agent-sdk-auto-instrumentation-node-hook

shows that wrapper-only assertions are still needed for tool spans, nested subagent spans, and failure-tool details.

Expected

Auto-instrumentation should emit trace detail that is closer to the wrapper path, especially for tool execution, subagent nesting, and failure spans.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions