Repository navigation
feat: support OpenTelemetry span customizers - #2615
Draft
Andrew Kent (realark) wants to merge 1 commit into
Draft
Andrew Kent (realark) wants to merge 1 commit into
Andrew Kent (realark) wants to merge 1 commit into
Conversation
Andrew Kent (realark)
force-pushed
the
ark/SDK-473-otel-span-customizers
branch
from
October 12, 2026 19:36
d29b783 to
17a4bd0
Compare
Contributor
Author
|
Amended the single SDK-473 commit to 17a4bd0: removed the obsolete isOtelCompatMode helper and made the standalone ESM/CJS export smoke use node:util promisify rather than Promise.withResolvers, which Node 20 does not implement. Both OTel matrices pass all 151 tests locally under Node 20.20.2, including real HTTP exports. All hosted CI checks now pass, including the full OTel v1/v2 × Node 20/22/24/26 matrix, native Linux/Windows suites, build/type/lint/dead-code checks, smoke tests, e2e, and changeset validation: https://github.com/braintrustdata/braintrust-sdk-javascript/actions/runs/38298754195 |
This branch has not been deployed
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
Implements SDK-473.
Stacked on SDK-472: depends on #2614; base is
ark/SDK-472-customizer-error-handling, not main. This is one new feature commit on that branch.configureInstrumentation({ spanCustomizers })and synchronousonSpanExportthrough a shared internal SDK runner; remove the compatibility-mode registration/setup guards.attributes,name,kind,status,events,links,resource,instrumentationScope, object-valuedspanContext, parent context/ID and OTel time arrays. Replacements are not implicitly merged.braintrust.context_jsonexactly{"customizer_error":true}. Strip origin, payload, resource/scope metadata, events, links and status descriptions. Native and OTel failures share one safe diagnostic across ESM/CJS bundles.Compatibility / release
@braintrust/otelnow requiresbraintrust >=3.38.0, the next minor selected by this changeset, for the shared policy API. There is deliberately no silent fallback to uncustomized export with an older SDK. The two isolated OTel fixture lockfiles were updated; package versions were not manually edited. Native logging remains native in OTel compatibility mode.Verification
braintrustand@braintrust/otel(ESM, CJS and declarations).check:typings(source and test declarations) passed.span-customizer,logger,span-origin).The matrix was installed with pinned
pnpm@10.33.0 --ignore-workspace;CIwas unset for the local matrix because this environment globally sets it and an existing environment-detection test expects a non-CI process. No live Braintrust endpoint or provider credentials were needed; transport evidence is local HTTP, not a mocked serializer.