-
Notifications
You must be signed in to change notification settings - Fork 825
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)!: remove ability to have BasicTracerProvider instantiate exporters #5239
base: next
Are you sure you want to change the base?
Conversation
…asicTracerProvider class
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #5239 +/- ##
==========================================
- Coverage 94.56% 94.52% -0.04%
==========================================
Files 316 316
Lines 8037 8020 -17
Branches 1628 1622 -6
==========================================
- Hits 7600 7581 -19
- Misses 437 439 +2
|
…rs to BasicTracerProvider class
@@ -255,16 +235,4 @@ export class BasicTracerProvider implements TracerProvider { | |||
}); | |||
} | |||
} | |||
|
|||
protected _buildExporterFromEnv(): SpanExporter | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so IIUC it means now BasicTraceProvider
wont' look up to env to resolve the exporter and it is mandatory to pass it into the constructor right?
This means NodeSDK
or any other component creating the provider is responsible to resolve the exporter from env if applies right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so IIUC it means now BasicTraceProvider wont' look up to env to resolve the exporter and it is mandatory to pass it into the constructor right?
This means NodeSDK or any other component creating the provider is responsible to resolve the exporter from env if applies right?
Yep - that's the solution I'd propose. 🙂
This PR is just a proposal, so we don't have to do it, but I feel like this is a cleaner approach as we'd eliminate an additional (confusing) way to accomplish the same thing.
Neither the LoggerProvider
nor MeterProvider
have equivalent functionality and I'm not aware of any requests that I remember that asked for adding it. 🤔 Removing it also has the bonus of aligning functionality between the three signals. I'd like to align the three signals as much as possible to give a more consistent experience to end-users.
Which problem is this PR solving?
This is apparently a feature we offer - overriding a static property to register exporters, which can then be instantiated via env vars. And also overriding methods that facilitate the creation of exporter via env vars. It ends up in both Web and Node.js tracing packages.
I don't recall the context of why this was added but I know it was used in
NodeSDK
but that offers a better approach now that does not rely on that behavior anymore. I reckon few of our users even know that this feature exists.This PR proposes removing this feature. If this feature is needed, we can just provide a function that does this (or they can implement it themselves, it's trivial to do), and require the person to pass it the result to the constructor as
spanProcessors
, which should be much cleaner.I'm not sure yet what to do with propagators which offer a similar functionality, but I'm confident that we can come up with a simpler to use/maintain/understand solution for that.
Type of change
How Has This Been Tested?