-
Notifications
You must be signed in to change notification settings - Fork 810
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(node-sdk): add spanProcessors option #4454
feat(node-sdk): add spanProcessors option #4454
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4454 +/- ##
==========================================
+ Coverage 92.37% 92.43% +0.05%
==========================================
Files 304 330 +26
Lines 8682 9504 +822
Branches 1831 2026 +195
==========================================
+ Hits 8020 8785 +765
- Misses 662 719 +57
|
921c71e
to
af7b892
Compare
67e37ab
to
9011815
Compare
This is now ready for review. As per today's SIG this adds the spanProcessors (array) option to node-sdk |
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.
Thanks @naseemkullah 🙂
Looks good % nits
Since span processors can be chained together, it makes sense to expose this option as an array of span processors. This change also deprecates the `spanProcessor` option in favor of `spanProcessors`.
8926483
to
c8c3072
Compare
Thanks @pichlermarc! |
Related to #4451, it would be good to add LogProcessors as well. |
…3270) Currently, `NodeSDK` does not support multiple-span processors and exporters. This functionality [was added](open-telemetry/opentelemetry-js#4454) three weeks ago and will be included in [the following experimental release](open-telemetry/opentelemetry-js#4504). To fix the problem without waiting for the release, I migrated this functionality to lower-level primitives, where we have complete control over the number of exporters.
…3270) Currently, `NodeSDK` does not support multiple-span processors and exporters. This functionality [was added](open-telemetry/opentelemetry-js#4454) three weeks ago and will be included in [the following experimental release](open-telemetry/opentelemetry-js#4504). To fix the problem without waiting for the release, I migrated this functionality to lower-level primitives, where we have complete control over the number of exporters.
Which problem is this PR solving?
Since registered span processors are chained together via that active multispanprocessor, it makes sense to expose the option as an array of span processors. As such this change also deprecates the
spanProcessor
option in favor of the new, more flexiblespanProcessors
option.use case: suppose you are happy with the default batchspan processor, but rather not override any of its hooks and just add a subsequent processor that does something e.g. extracts baggage and adds the baggage entries to spans (side note: an off the shelf baggage extractor span processor might be nice!).
Fixes # (issue)
Short description of the changes
add a spanProcessors config option. convert the original/deprecated spanProcessor config to an array of one if used. we now loop over the spanProcessors and register them to the tracer provider.
n.b. if someone so happens to set both spanProcessor and spanProcessors it will default to using the latter, non deprecated option
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
addedmodified