refactor(sandbox): migrate SDK setup to official startBrowserSdk#346
Merged
joaquin-diaz merged 7 commits intoJul 16, 2026
Merged
Conversation
overbalance
reviewed
Jul 10, 2026
overbalance
reviewed
Jul 10, 2026
| // Batch processor settings shared by the traces and logs exporters. Passing | ||
| // this alongside `exportConfig` makes the SDK append a batching OTLP exporter | ||
| // after our custom processors below. | ||
| const BATCH_PROCESSOR_CONFIG = { |
Contributor
There was a problem hiding this comment.
Do we have a type for this?
Contributor
Author
There was a problem hiding this comment.
Indeed there is TracesConfig['batchProcessorConfig']
overbalance
requested changes
Jul 10, 2026
…ndbox_start_browser_sdk # Conflicts: # package-lock.json # sandbox/package.json
overbalance
approved these changes
Jul 15, 2026
joaquin-diaz
approved these changes
Jul 16, 2026
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.
Which problem is this PR solving?
Replace the hand-wired
WebTracerProvider/LoggerProvidersetup in thesandbox with the official
@opentelemetry/browser-sdkstartBrowserSdkentry point, keeping the instrumented behavior identical:
exporters, via traces.processors / logs.processors
batchProcessorConfig (maxExportBatchSize 10, scheduledDelayMillis 1000)
explicitly to reproduce WebTracerProvider.register() defaults, so
fetch/XHR context propagation and header injection keep working
QA
npm run devis still showcasing that the SDK is still loaded properly and reporting the starting the same instrumentations.github.iodeployment of the sandbox underhttps://open-telemetry.github.io/opentelemetry-browser/will be the followup to QA the changeDecorative code snippet has also been updated but with the goal of not being exhaustive.
Follow up PR
I plan to work on a small Mock Service Worker like https://www.npmjs.com/package/msw to showcase how payloads are sent to intake. I will however discuss about it with the SIG to see if there is traction about this.