Add span origin provenance#2226
Conversation
a1930f9 to
ec05ec1
Compare
d25d857 to
efa7db3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efa7db3e0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| const envType = process.env.BRAINTRUST_ENVIRONMENT_TYPE; | ||
| const envName = process.env.BRAINTRUST_ENVIRONMENT_NAME; |
There was a problem hiding this comment.
Read provenance env vars through the SDK env helper
When @braintrust/otel is configured with BRAINTRUST_ENVIRONMENT_TYPE or BRAINTRUST_ENVIRONMENT_NAME only in the nearest .env.braintrust file, this direct process.env lookup misses them because the Braintrust node config reads that file via _internalIso.getEnv without populating process.env. The processor already supports .env.braintrust for API keys, so spans exported through this path will omit span_origin.environment in that same setup unless these reads use the SDK env helper/shared detector.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "braintrust": minor | |||
There was a problem hiding this comment.
Add the @braintrust/otel package to this changeset
This commit changes @braintrust/otel runtime behavior and adds an environment processor option, but the changeset only lists braintrust. Packages not listed in the changeset will not receive a version bump/release, so the new OTEL span provenance code described here would not be published to users of @braintrust/otel.
Useful? React with 👍 / 👎.
Summary
Adds span origin provenance to the TypeScript SDK direct logging and OpenTelemetry paths, including .env.braintrust environment detection.
Validation