Skip to content
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-node): support xray propagator #4602

Merged
merged 10 commits into from
May 3, 2024

Conversation

anuraags
Copy link
Contributor

@anuraags anuraags commented Apr 3, 2024

Which problem is this PR solving?

Currently the NodeTracerProvider in the opentelemetry-sdk-trace-node package doesn't provide support for an AWS xray propagator.

If I try to use the node sdk and set the OTEL_PROPAGATORS environment variable to xray, it complains that:

Propagator "xray" requested through environment variable is unavailable.

The reason for this is that the NodeTracerProvider doesn't have the AWS XRAY propagator as a registered propagator.

Short description of the changes

This PR simply adds the AWSXRAYPropagator as a registere propagator in the NodeTracerProvider class. It also adds the AWSXrayPropagator package dependency to the opentelemetry-sdk-trace-node package.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I updated the environment variable in the NodeTracerProvider test in packages/opentelemetry-sdk-trace-node/test/NodeTracerProvider.test.ts to include xray and updated the resulting propagation fields.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@anuraags anuraags requested a review from a team April 3, 2024 00:40
Copy link

linux-foundation-easycla bot commented Apr 3, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@anuraags anuraags changed the title Xray propagator fix(opentelemetry-sdk-trace-node): support xray propagator Apr 3, 2024
Revert newline change
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a feature, not a bugfix.
We don't depend on contrib packages from the core repo, so this depends on #4603 being done first.

Please convert this PR to draft until it's ready for review.

@Flarna
Copy link
Member

Flarna commented Apr 3, 2024

Is it really needed to depend on xray propagator and require it unconditionally?

There are a lot workloads which will not use xray propagator therefore I think we should not force people to install it.

If we stick on this depends on design other propagators (and maybe other components like exporters, context managers, span processors,...) will follow and SDK will grow for no reason without any chance to opt out.

@anuraags
Copy link
Contributor Author

anuraags commented Apr 3, 2024

Is it really needed to depend on xray propagator and require it unconditionally?

There are a lot workloads which will not use xray propagator therefore I think we should not force people to install it.

If we stick on this depends on design other propagators (and maybe other components like exporters, context managers, span processors,...) will follow and SDK will grow for no reason without any chance to opt out.

My argument to that would be that there is already a jaeger propagator that is baked into the tracer provider at the moment. So what makes jaeger special and not xray?

Also, I thought the the open telemetry way was to opt in to everything through environment variables, so it's not technically unconditional?

@anuraags
Copy link
Contributor Author

anuraags commented Apr 3, 2024

This is a feature, not a bugfix.
We don't depend on contrib packages from the core repo, so this depends on #4603 being done first.

Please convert this PR to draft until it's ready for review.

Will do

@anuraags anuraags changed the title fix(opentelemetry-sdk-trace-node): support xray propagator feat(opentelemetry-sdk-trace-node): support xray propagator Apr 3, 2024
@martinkuba
Copy link
Contributor

For tracking purposes, I have this listed as a subtask in #4494

@anuraags anuraags marked this pull request as draft April 3, 2024 23:05
@anuraags
Copy link
Contributor Author

anuraags commented Apr 3, 2024

Thank you @martinkuba !

@Flarna
Copy link
Member

Flarna commented Apr 4, 2024

My argument to that would be that there is already a jaeger propagator that is baked into the tracer provider at the moment. So what makes jaeger special and not xray?

Also, I thought the the open telemetry way was to opt in to everything through environment variables, so it's not technically unconditional?

You are right, it's not xray specific.
After commenting here I saw #4494 and added also a similar comment there. Let's continue discussion there as it fits better.

@anuraags
Copy link
Contributor Author

@pichlermarc @martinkuba I have updated this PR now to incorporate the changes in #4603
Are we happy to move this out of draft?

@martinkuba
Copy link
Contributor

martinkuba commented Apr 18, 2024

@pichlermarc @martinkuba I have updated this PR now to incorporate the changes in #4603 Are we happy to move this out of draft?

Based on this #4494 (comment), I think we want to move the propagators from trace-base to sdk-node. @pichlermarc, can we do this now or does that need to be part of 2.0? And if that's the case, should we add the xray propagators to trace-base now and move all at the same time in 2.0?

@pichlermarc
Copy link
Member

@pichlermarc @martinkuba I have updated this PR now to incorporate the changes in #4603 Are we happy to move this out of draft?

Based on this #4494 (comment), I think we want to move the propagators from trace-base to sdk-node. @pichlermarc, can we do this now or does that need to be part of 2.0? And if that's the case, should we add the xray propagators to trace-base now and move all at the same time in 2.0?

IMO we should leave the ones that are in trace-base as-is (not adding any new ones for now) any add any new spec-required ones to sdk-node only.

In SDK 2.0 we remove the propagators from trace-base.

@anuraags
Copy link
Contributor Author

Okay....I'll take this out of draft status then

@anuraags anuraags marked this pull request as ready for review April 22, 2024 00:35
@martinkuba
Copy link
Contributor

@pichlermarc Per #4494 (comment), I think you want to have this in the node-sdk package. But it seems to me like it would be fine in sdk-trace-node? Not as a long-term solution, but just for the xray propagators in 1.x. My concern is that documentation for the lambda instrumentation currently shows using NodeTracerProvider directly (instead of NodeSDK).

Could we add it here for 1.x and then move everything to NodeSDK in 2.0?

Copy link
Contributor

@martinkuba martinkuba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed in SIG meeting on 4/24. In the future (likely 2.0), we want to have this configuration in one place, so it should reside in the sdk-node package. However, since there are already multiple places right now, we agreed that it is ok to add this to sdk-trace-node for now.

@pichlermarc pichlermarc changed the title feat(opentelemetry-sdk-trace-node): support xray propagator feat(sdk-trace-node): support xray propagator May 3, 2024
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as discussed in the SIG meeting. I took the liberty to update the changelog and rebase the PR.

NOTE: In SDK 2.0 we will drop auto-configuration of propagators from this package entirely, which will include this propagator. #4672

@pichlermarc pichlermarc merged commit 75d88f7 into open-telemetry:main May 3, 2024
19 checks passed
pichlermarc added a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request May 22, 2024
@pichlermarc
Copy link
Member

@anuraags FYI we've discovered that this is not spec-compliant as we MUST NOT have the AWS propagator as part of the core repository (and therefore we cannot distribute the propgator be part of core components like the trace SDK - unless the spec changes). Therefore we'll have to roll back this change (see #4727).

As a workaround I plan to introduce a getPropagator() function in the @opentelemetry/auto-instrumentations-node metapackage which will include all third-party propagators. open-telemetry/opentelemetry-js-contrib#2232

pichlermarc added a commit that referenced this pull request May 23, 2024
* Revert "feat(sdk-trace-node): support xray propagator (#4602)"

This reverts commit 75d88f7.

* chore: sync package-lock.json
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
* fix(opentelemetry-sdk-trace-node): support xray propagator

Signed-off-by: Anu Sridhar <[email protected]>

* linter fix

Signed-off-by: Anu Sridhar <[email protected]>

* Build trigger

* Update package.json

Revert newline change

* chore: add changelog entry

* fix: lint

---------

Signed-off-by: Anu Sridhar <[email protected]>
Co-authored-by: Marc Pichler <[email protected]>
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
…#4602)" (open-telemetry#4727)

* Revert "feat(sdk-trace-node): support xray propagator (open-telemetry#4602)"

This reverts commit 75d88f7.

* chore: sync package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants