[sdk-trace-*] breaking clean-up of features that do not exist in logs and metrics SDKs #5290
Labels
feature-request
pkg:sdk-trace-base
pkg:sdk-trace-node
pkg:sdk-trace-web
target:next-major-release
This PR targets the next major release (`next` branch)
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: