Commit 3f69bfd
committed
feat(node): Enhance Claude Code instrumentation with OpenTelemetry spec compliance
- Fix GEN_AI_SYSTEM_ATTRIBUTE to use 'anthropic' per OpenTelemetry semantic conventions
- Add GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE for capturing available tools from system init
- Add GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE for tracking stop_reason
- Use getTruncatedJsonString for proper payload truncation in span attributes
- Expand tool categorization with new tools (KillBash, EnterPlanMode, AskUserQuestion, Skill, MCP tools)
- Add better error metadata with function name in mechanism data
- Export patchClaudeCodeQuery for manual instrumentation use cases
- Add comprehensive integration tests for Claude Code Agent SDK instrumentation1 parent a5b8330 commit 3f69bfd
17 files changed
Lines changed: 1444 additions & 269 deletions
File tree
- dev-packages/node-integration-tests/suites/tracing/claude-code
- packages
- core/src
- tracing/ai
- nextjs/src/server
- node/src
- integrations/tracing/claude-code
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments