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

NodeJS Lambda Layer: X-Ray propagation not working #958

Closed
daniel-ferguson opened this issue Jul 8, 2024 · 2 comments
Closed

NodeJS Lambda Layer: X-Ray propagation not working #958

daniel-ferguson opened this issue Jul 8, 2024 · 2 comments
Labels

Comments

@daniel-ferguson
Copy link

daniel-ferguson commented Jul 8, 2024

Describe the bug

After following https://aws-otel.github.io/docs/getting-started/lambda/lambda-js to add a layer to my lambda function I can see traces being generated, and showing up in X-Ray. However, no HTTP services that this function calls are connected to the trace. Looking at the HTTP headers received by a downstream I see Traceparent: set correctly, but no X-Amzn-Trace-Id: - indicating that auto-instrumentation & propagation is working, but not with the X-Ray propagator.

Looking at the logs I see the lines:

Registering OpenTelemetry
Propagator "xray" requested through environment variable is unavailable. 

I know opentelemetry-js currently doesn't support setting the propagator via the OTEL_PROPAGATORS environment variable (open-telemetry/opentelemetry-js#4727) - but I saw you have in place something that looks like it could be workaround, manually intialising an X-Ray propagator: https://github.com/aws-observability/aws-otel-lambda/blob/b685c99d626e6e71034c69369bda00317665602f/nodejs/wrapper-adot/src/adot-extension.ts

By changing that code to always set global.configureSdkRegistration, rather than only do it when OTEL_PROPAGATORS is falsey results in trace propagation working correctly. I confirmed this by making the change, running build.sh and using the resulting lambda layer with my function.

What version of collector/language SDK version did you use?
Collector: v0.39.0
Lambda instrumentation: v0.41.0
OpenTelemetry for Javascript: v1.18.1

What language layer did you use?
Config: NodeJS

@daniel-ferguson daniel-ferguson changed the title NodeJS X-Ray propagation not working NodeJS Lambda Layer: X-Ray propagation not working Jul 8, 2024
Copy link

github-actions bot commented Oct 6, 2024

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

@github-actions github-actions bot added the stale label Oct 6, 2024
Copy link

This issue was closed because it has been marked as stale for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant