Skip to content

feat(spans): attribute every span to the emitting integration#104

Merged
rgao-coreweave merged 1 commit into
mainfrom
feat/integration-attribution
Jun 17, 2026
Merged

feat(spans): attribute every span to the emitting integration#104
rgao-coreweave merged 1 commit into
mainfrom
feat/integration-attribution

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Stamps integration identity on every span so Weave can group/filter by it.

Key Value
weave.integration.name weave-claude-code
weave.integration.version plugin version
weave.integration.meta.claude_code_app_version CC CLI version (best-effort, from transcript)

How

Per-session OTel Baggage, built at SessionStart and activated per event in routeEvent; IntegrationBaggageSpanProcessor copies the weave.integration.* entries onto each span at onStart. Non-semconv weave.* keys land in the Agents backend's queryable custom_attrs_* maps; resource attrs aren't queryable, so it lives on the span.

Test

tests/turn-span-integration.test.ts drives a session through routeEvent and asserts the turn, chat, tool, and text spans carry the attrs, with the trace tree intact. Suite 54/54, build clean (npm run check).

🤖 Generated with Claude Code

@w-b-hivemind

w-b-hivemind Bot commented Jun 17, 2026

Copy link
Copy Markdown

HiveMind Sessions

2 sessions · 53m · $28

Session Agent Duration Tokens Cost Lines
Code Review Reception And Pr Fixes
7dde1aba-91c0-4c44-a8bf-9a147e593889
claude 36s 11.0K $0.29 +0 -0
Add Integration Attribution to Weave SDK Spans
a54a8758-5a2d-4b02-9bed-68fb343b6fe3
claude 53m 241.9K $28 +289 -82
Total 53m 253.0K $28 +289 -82

View all sessions in HiveMind →

Run claude --resume 7dde1aba-91c0-4c44-a8bf-9a147e593889 to pickup where you left off.

@rgao-coreweave rgao-coreweave force-pushed the feat/integration-attribution branch from 4e9c064 to 8271933 Compare June 17, 2026 01:25
Attribute traces to the emitting integration so Weave can group and
filter by integration (this plugin vs weave-openclaw vs the playground).

Integration identity (weave.integration.{name,version} plus free-form
weave.integration.meta.*) rides per-session OTel Baggage: the daemon
builds it at SessionStart and activates it for each event, and
IntegrationBaggageSpanProcessor copies it onto every span at onStart.
So chat / tool / subagent spans are filterable by integration, not just
the turn root.

These are non-semconv weave.* keys, so the Agents backend routes them
into its queryable custom-attribute maps. Resource attributes like
service.name are not queryable, so the marker has to live on the span.
claude_code_app_version is read best-effort from the transcript head line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rgao-coreweave rgao-coreweave force-pushed the feat/integration-attribution branch from 8271933 to f85c046 Compare June 17, 2026 03:01
@rgao-coreweave rgao-coreweave changed the title feat(spans): attribute traces to the emitting integration feat(spans): attribute every span to the emitting integration Jun 17, 2026
@rgao-coreweave rgao-coreweave marked this pull request as ready for review June 17, 2026 19:50
@rgao-coreweave rgao-coreweave requested a review from a team as a code owner June 17, 2026 19:50

@drtangible drtangible left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

@rgao-coreweave rgao-coreweave merged commit d3c2bcc into main Jun 17, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants