Skip to content

Add span origin provenance - #197

Open
Stephen Belanger (Qard) wants to merge 8 commits into
mainfrom
agent/span-origin-provenance
Open

Add span origin provenance#197
Stephen Belanger (Qard) wants to merge 8 commits into
mainfrom
agent/span-origin-provenance

Conversation

@Qard

Copy link
Copy Markdown
Contributor

Summary

  • Add span origin provenance to Ruby SDK spans.
  • Detect environment provenance from explicit config, Braintrust env vars, CI providers, server platforms, and Ruby deployment envs.
  • Exclude Braintrust system provenance attributes from AI span filtering.
  • Keep config environment helper methods private so they do not become public API surface.

Validation

  • mise exec ruby@3.2 -- bundle exec ruby -Ilib:test test/braintrust/config_test.rb test/braintrust/trace/span_filter_test.rb test/braintrust/trace/span_processor_test.rb
  • mise exec ruby@3.2 -- bundle exec standardrb lib/braintrust/config.rb lib/braintrust/trace/span_filter.rb lib/braintrust/trace/span_processor.rb test/braintrust/config_test.rb

@delner David Elner (delner) 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.

Thanks for putting this together!

My major questions around this revolve around:

  1. Wrapper design / method missing. I'd consider this a blocker.
  2. Environment reading. I think we could better consolidate/organize this.
  3. Public API from_env change. Might be acceptable, just want to clarify on the story of how this overlaps with our state management story.

These things are manageable, but may require some significant refactoring.

Comment thread lib/braintrust/trace/span_processor.rb Outdated
Comment thread lib/braintrust/trace/span_processor.rb Outdated
Comment thread lib/braintrust/config.rb Outdated
Comment thread lib/braintrust/config.rb Outdated
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.

3 participants