feat: add @opentelemetry/browser-sdk package#288
Conversation
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
Co-authored-by: Jared Freeze <overbalance@users.noreply.github.com>
…owser into otel-browser
…owser into otel-browser
|
I wonder if the directory this package is in should be called |
If we want to align with the existing instrumentation package then we should:
I'm okay with that. I would add a review to the package exports section for better naming. This might look weird import { strartBrowserSdk } from '@opentelemetry/browser-sdk/sdk';
// rest of the code |
@opentelemetry/browser package@opentelemetry/browser-sdk package
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| url: ${{ steps.deploy.outputs.page_url }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/open-telemetry/opentelemetry-browser.git", | ||
| "directory": "packages/browser" |
Which problem is this PR solving?
Follow up on #224. This PR is now targeting a feature branch so we can break down the implementation in smaller PRs and merge it to main once its ready.
Short description of the changes
@opentelemetry/browserpackagestartBrowserSdkfunction instead of the combine utility. The reason is there is no other use case. Either you start one single SDK or both. The combine function stays internal until we decide to add a third signal (metrics).This PR aims to define the main API to configure the signals (logs, traces) separate and together. Also it explores on how to provide a flexible way for defaults without having to pay the toll on bundle size.
For those who want to read
Add a new package named
@opentelemetry/browserwhich holds the setup of the different signals separately and provides a main function which composes them together into an SDK interface withstopmethod.This approach has taken into consideration that configuring all signals into a single SDK class presents challenges when it comes to tree shaking and bundlers cannot anticipate which modules are going to be used. So the configuration has been split by signal and needs to be imported explicitly by the consumer making easier for bundlers to analyse the code and remove unused modules. The package provides different entry points depending on which signal you want to configure
@opentelemetry/browser/logsstartLogsSdk— setup logs@opentelemetry/browser/tracesstartTracesSdk— setup traces@opentelemetry/browser/sdkstartBrowserSdk— setup bothwith this approach you can configure a single signal
or both at the same time
Note: the intent is to have all necessary components to start/build SDKs in this package. This PR does not go any further than providing a small API (3 functions) and configurations types for several reasons:
Also this PR targets a feature branch and not main so the package won't be published until the SIG decides it has all it need to be public.
For more details on the package and its design refer to the
README.mdfile of the package.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: