You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
daniel-ferguson
changed the title
NodeJS X-Ray propagation not working
NodeJS Lambda Layer: X-Ray propagation not working
Jul 8, 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
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 noX-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:
I know
opentelemetry-js
currently doesn't support setting the propagator via theOTEL_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.tsBy changing that code to always set
global.configureSdkRegistration
, rather than only do it whenOTEL_PROPAGATORS
is falsey results in trace propagation working correctly. I confirmed this by making the change, runningbuild.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
The text was updated successfully, but these errors were encountered: