feat(node-sdk): add spanProcessors option - #4454
Merged
naseemkullah merged 1 commit intoFeb 5, 2024
Merged
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
|
naseemkullah
force-pushed
the
node-sdk-span-processors
branch
from
January 31, 2024 22:07
921c71e to
af7b892
Compare
naseemkullah
marked this pull request as draft
January 31, 2024 22:08
naseemkullah
force-pushed
the
node-sdk-span-processors
branch
5 times, most recently
from
February 1, 2024 01:46
67e37ab to
9011815
Compare
naseemkullah
marked this pull request as ready for review
February 1, 2024 01:46
Member
Author
|
This is now ready for review. As per today's SIG this adds the spanProcessors (array) option to node-sdk |
pichlermarc
approved these changes
Feb 1, 2024
pichlermarc
left a comment
Member
There was a problem hiding this comment.
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`.
naseemkullah
force-pushed
the
node-sdk-span-processors
branch
from
February 1, 2024 15:19
8926483 to
c8c3072
Compare
Member
Author
|
Thanks @pichlermarc! |
Member
|
Related to #4451, it would be good to add LogProcessors as well. |
valerybugakov
added a commit
to sourcegraph/cody-public-snapshot
that referenced
this pull request
Feb 27, 2024
…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.
steveyegge
pushed a commit
to sourcegraph/cody-public-snapshot
that referenced
this pull request
Mar 13, 2024
…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.
This was referenced May 28, 2024
Open
5 tasks
Zirak
pushed a commit
to Zirak/opentelemetry-js
that referenced
this pull request
Sep 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
spanProcessoroption in favor of the new, more flexiblespanProcessorsoption.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