feat: add OpenTelemetry support for telemetry metrics and tracing #542
+2,165
−567
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
claude_agent_sdk.<layer>.<operation>), plus new top‑level lifecycle spans forClaudeSDKClientand one‑shotquery()usage.Spans Added/Updated
claude_agent_sdk.client.connect,claude_agent_sdk.client.query,claude_agent_sdk.client.disconnectclaude_agent_sdk.query.lifecycle,claude_agent_sdk.query.initialize,claude_agent_sdk.query.read_messages,claude_agent_sdk.query.stream_input,claude_agent_sdk.query.closeclaude_agent_sdk.transport.connect,claude_agent_sdk.transport.read_messages,claude_agent_sdk.transport.write,claude_agent_sdk.transport.closeclaude_agent_sdk.permission.can_use_tool,claude_agent_sdk.hooks.callbackclaude_agent_sdk.mcp.request,claude_agent_sdk.mcp.tool_callclaude_agent_sdk.cli.tool_callMetrics Added
messages,results,errors,invocationstokens.prompt,tokens.completion,tokens.totalmodel.latency_ms,model.errorsresult.duration_ms,result.cost_usd,cost.total_usdresponse.size_bytes,throttledsession.idfor grouping.