feat(spans): attribute every span to the emitting integration#104
Merged
Conversation
HiveMind Sessions2 sessions · 53m · $28
View all sessions in HiveMind → Run |
4e9c064 to
8271933
Compare
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>
8271933 to
f85c046
Compare
andrewtruong
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Stamps integration identity on every span so Weave can group/filter by it.
weave.integration.nameweave-claude-codeweave.integration.versionweave.integration.meta.claude_code_app_versionHow
Per-session OTel Baggage, built at SessionStart and activated per event in
routeEvent;IntegrationBaggageSpanProcessorcopies theweave.integration.*entries onto each span atonStart. Non-semconvweave.*keys land in the Agents backend's queryablecustom_attrs_*maps; resource attrs aren't queryable, so it lives on the span.Test
tests/turn-span-integration.test.tsdrives a session throughrouteEventand 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