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

Enable X-Ray propagator for nodejs-instrumentation #1872

Closed

Conversation

ademar-prothon
Copy link

Following issue

Added X-Ray propagator in the NodeSDK constructor.
I'm not sure how propragators are configured, is it the NodeSDK selecting the right propagator based on env variable config or should we implement this logic on our side ?

Thanks,

@ademar-prothon ademar-prothon requested a review from a team June 27, 2023 20:06
@linux-foundation-easycla
Copy link

CLA Missing ID CLA Not Signed

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

@ademar-prothon thank you for the contribution, please sign the CLA.

@TylerHelmuth
Copy link
Member

@open-telemetry/javascript-approvers can you please advise the best way to make propagators available for use via the OTEL_PROPAGATORS env var when using NodeSDK from @opentelemetry/sdk-node?

@pichlermarc
Copy link
Member

@open-telemetry/javascript-approvers can you please advise the best way to make propagators available for use via the OTEL_PROPAGATORS env var when using NodeSDK from @opentelemetry/sdk-node?

Sorry for the late reply, right now NodeSDK does not automatically pick up any third-party propagators, so implementing the logic here is an option, though contributing that feature to the @opentelemetry/sdk-node the module over at https://github.com/open-telemetry/opentelemetry-js/ would also be appreciated.

@@ -35,6 +36,7 @@ function getMetricReader() {
const sdk = new NodeSDK({
autoDetectResources: true,
instrumentations: [getNodeAutoInstrumentations()],
textMapPropagator: new AWSXRayPropagator(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this change make the default propagator x-ray? I don't think this is what we would want in the OpenTelemetry Operator. Ideally we could configure the propagator through an environment variable.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. The javascript SDK must recognize all of these values to meet spec. @pichlermarc do know know how the OTEL_PROPAGATORS env var interacts with NodeSDK? If NodeSDK doesn't honor OTEL_PROPAGATORS that feels like a bug.

Copy link
Member

Choose a reason for hiding this comment

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

NodeSDK does honor OTEL_PROPAGATORS for the internal values (tracecontext, baggage, b3, b3multi, jaeger), via the NodeTracerProvider that is used in the SDK.. The third party options xray and ottrace are available in the js-contrib repo and currently only added via code, not yet available as an environment variable option.

Copy link
Member

@TylerHelmuth TylerHelmuth Jul 6, 2023

Choose a reason for hiding this comment

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

@JamieDanielson thanks for the details. @ademar-prothon at this point I don't think there is anything we should change in the operator. Instead it would be good to add this functionality to opentelemetry-js directly so that I can enable the xray propagator via the env variable.

Once that feature is release from opentelemetry-js we can update the operator's dependencies.

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.

5 participants