-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sdk-trace-base)!: remove BasicTracerProvider#register() to improve tree-shaking #5503
feat(sdk-trace-base)!: remove BasicTracerProvider#register() to improve tree-shaking #5503
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5503 +/- ##
=======================================
Coverage 94.95% 94.95%
=======================================
Files 309 309
Lines 7924 7931 +7
Branches 1606 1604 -2
=======================================
+ Hits 7524 7531 +7
Misses 400 400
|
…o improve tree-shaking
There are some references to
|
Oh, good catch - I forgot to search for it in the other |
I guess Also I see occurrences in several tests related to exporters and processors. do you think it's okay to use |
IIUC it was meant to be used by end-users as an unopinionated minimal implementation of the spec and that For Node.js, For the Browser, Ideally I'd like to fully replace
I think that's fine (should be encouraged even). The tests often use the more minimal implementation to maximize compatibility and reduce the chance of internal behavior changes breaking tests. |
But that's something for 3.0 and beyond. 🙂 |
Which problem is this PR solving?
Removes
BasicTracerProvider#register()
, which in the past has auto-registered aW3CTraceContextPropagator
andW3CBaggagePropagator
, requiring it being included in bundles even when unused.NodeTracerProvider#register()
andWebTraceProvider#register()
still provide the same behavior so impact to end-users should be minimal. Everyone that does not want to use the defaults can now useBasicTracerProvider
withtrace.setGlobalTracerProvider()
,propagation.setGlobalPropagator()
andcontext.setGlobalContextManager()
to register, while not including the unused context managers/propagators in their bundle.Refs #5290
Type of change
How Has This Been Tested?