Skip to content

Conversation

@slavinnj-bt
Copy link

We recommend considering "...projects analogous to an AI feature in your application." Customers may have multiple projects defined for different features in the same application, especially for large monolithic apps. This PR creates an example showing multiple OTEL tracer providers, each scoped to a non-global state and a separate Braintrust project. It also makes some updates to the README, including for already existing tracing and eval examples.

@slavinnj-bt slavinnj-bt added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 24, 2025
model2 = "claude-sonnet-4"

# check for API keys
unless ENV["OPENAI_API_KEY"] && ENV["ANTHROPIC_API_KEY"]
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed

Copy link
Contributor

@clutchski clutchski left a comment

Choose a reason for hiding this comment

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

We can achieve this in a simpler way. You only need to set the braintrust.parent tag on a span and then it will get sent to that project. See here.
https://gist.github.com/clutchski/74fa36bfb62301dad88924ce39449552

What we should do is have some nice helper functions to do this:

  • e.g. set_parent(span, 'project_id:1243') or set_parent(span, Parent.project_id("123"))

Also in general, multiple tracer providers isn't really advisable because our customers instrumentation won't look them up, they'll just use the global tracer provider.

@clutchski clutchski closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants