-
Notifications
You must be signed in to change notification settings - Fork 838
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
[sdk-trace-*] breaking clean-up of features that do not exist in logs and metrics SDKs #5290
Comments
Here's an example of how I'd remove the exporter instantiation functionality: #5239. It's the first step - and I think the one with the least impact for end-users if we decide to go this route. |
I think this is well reasoned and agree with everything here. +1 from me |
cc @open-telemetry/javascript-approvers if there are no objections then I'll break this down into implementation issues 🙂 Please let me know if you have objections. |
+1 |
Alright, marking this as accepted 🙂
|
Description
@opentelemetry/sdk-trace
packages do include some features that are barely used and not present in other SDKs, such as the ability to override a method to have it create exporters based on environment variables) - a feature that has since been moved to@opentelemetry/sdk-node
).There are also other features that are remnants of times where the trace SDK was the only one that existed (
BasicTracerProvider#register()
, for instance), this is functionality that can be moved to@opentelemetry/sdk-node
instead.Proposal
We remove these features to avoid duplication of logic our packages, basically everything here:
opentelemetry-js/packages/opentelemetry-sdk-trace-base/src/BasicTracerProvider.ts
Lines 204 to 270 in 4179ddb
BasicTracerProvider#register()
can be removed fromBasicTracerProvider
and moved to a stand-alone function to provide a migration path for people that cannot use@opentelemetry/sdk-node
(this is the proposal from #4672, but when done right can also take care of #2218)opentelemetry-js/packages/opentelemetry-sdk-trace-base/src/BasicTracerProvider.ts
Lines 129 to 149 in 4179ddb
Then we can make it so that a
ContextManager
andPropagator
gets registered whenever any SDK (including logs, metrics) is registered by@opentelemetry/sdk-node
, which takes care of #3862, which is a commonly encountered issue.This then also lets us remove
opentelemetry-js/packages/opentelemetry-sdk-trace-base/src/BasicTracerProvider.ts
Lines 57 to 68 in 4179ddb
which has been a source of confusion in the past, and encourages some pretty odd patterns that we previously used in
@opentelemetry/sdk-node
but that @david-luna fortunately already cleaned up in #5138That then leads us to a point where there's almost no difference between
NodeTracerProvider
andWebTracerProvider
so we could consolidate them into a single package@opentelemetry/sdk-trace
, which will align the trace package name with the other SDK package like@opentelemetry/sdk-logs
and@opentelemetry/sdk-metrics
. Any remaining functionality exported from@opentelemetry/sdk-trace-web
can be changed to be a@opentelemetry/instrumentation-utils-web
package or similar, or moved to the actual instrumentation packages that use these utils to eliminate the need for it completely.In short: doing this will let us remove a lot of code, eliminates differences between the SDKs, and simplifies work on the Trace SDK going forward - especially around #4672 and #5217
The text was updated successfully, but these errors were encountered: