Skip to content

Make tracing spans create real Group observations#68

Merged
Dig-Doug merged 4 commits intomainfrom
span-as-group
Feb 28, 2026
Merged

Make tracing spans create real Group observations#68
Dig-Doug merged 4 commits intomainfrom
span-as-group

Conversation

@Dig-Doug
Copy link
Owner

Summary

  • Tracing spans now emit actual Group observations via GroupBuilder instead of ObservationType::Span with a phantom GroupHandle::from_id(), making spans proper hierarchical containers in the UI
  • Span fields are stored as metadata instead of a JSON payload, and duration is stored as separate duration_s and duration_ns metadata
  • Added source(), log_level(), and from_span() methods to GroupBuilder to support span-specific group creation

Test plan

  • All 7 tracing layer tests pass with updated assertions (Group type, parent_group_id, metadata-based fields)
  • Full workspace test suite passes (cargo test --workspace --all-features)
  • Verify spans appear as groups in the web UI

🤖 Generated with Claude Code

Dig-Doug and others added 4 commits February 28, 2026 10:35
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>
@Dig-Doug Dig-Doug merged commit f5bb24a into main Feb 28, 2026
1 check passed
@Dig-Doug Dig-Doug deleted the span-as-group branch February 28, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant