Make tracing spans create real Group observations#68
Merged
Conversation
Tracing spans now emit actual Group observations via GroupBuilder instead of using ObservationType::Span with a phantom GroupHandle. This makes spans proper hierarchical containers in the UI. - Add source(), log_level(), and from_span() to GroupBuilder - Rewrite on_close to use GroupBuilder::from_span() with chained public builder methods for id, source, and metadata - Store span fields as metadata instead of JSON payload - Store duration as separate seconds and nanoseconds metadata - Parent spans linked via parent_group_id instead of parent_span_id - Update tests for Group type and new metadata format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Group observations now add their own group ID to group_ids via .group(&group_handle), making the group discoverable by ID on the observation itself. Tests use group_ids[0] instead of looking up span_id from metadata for parent correlation assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make GroupBuilder::from_span() public so it can be used by external tracing integrations. Regenerate TypeScript bindings to reflect updated API surface including named payload methods and group builder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Groupobservations viaGroupBuilderinstead ofObservationType::Spanwith a phantomGroupHandle::from_id(), making spans proper hierarchical containers in the UIduration_sandduration_nsmetadatasource(),log_level(), andfrom_span()methods toGroupBuilderto support span-specific group creationTest plan
Grouptype,parent_group_id, metadata-based fields)cargo test --workspace --all-features)🤖 Generated with Claude Code