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

Propagate X-Ray tracing header #5

Closed
Morras opened this issue Jan 19, 2021 · 5 comments
Closed

Propagate X-Ray tracing header #5

Morras opened this issue Jan 19, 2021 · 5 comments

Comments

@Morras
Copy link

Morras commented Jan 19, 2021

According to the custom runtime documentation, the processing task should

Propagate the tracing header – Get the X-Ray tracing header from the Lambda-Runtime-Trace-Id header in the API response. Set the _X_AMZN_TRACE_ID environment variable locally with the same value. The X-Ray SDK uses this value to connect trace data between services.

Without the _X_AMZN_TRACE_ID the X-Ray SDK cannot create subsegments which essentially means X-Ray cannot be used with Lambda functions running with this graalvm runtime.

@mfriesen
Copy link
Member

@Morras should be fixed in 2.2.0 release. Please let me know if that fixes your issue.

@Morras
Copy link
Author

Morras commented Jan 20, 2021

Thank you so much for looking at this @mfriesen .

Unfortunately it does not work.

The X-Ray SDK is reading the value from the environment variables and not the system properties.
For reference the relevant SDK code is line 40 of this class and line 49-52 is the error I am getting when I run the Lambda function on graalvm.

Unfortunately there does not appear to be an easy way of changing environment variables at runtime from Java.
Work arounds are discussed in this StackOverflow post. Considering this would only need to work on Lambda's Linux environment, a workaround might be possible, but not that pretty.

@mfriesen
Copy link
Member

Hopefully this PR will get merged and the issue should be solved. aws/aws-xray-sdk-java#251

@mfriesen
Copy link
Member

Waiting on aws/aws-xray-sdk-java#251 to be released. This should be fixed for aws-xray-sdk-java > 2.8.0

@Morras
Copy link
Author

Morras commented Mar 5, 2021

We are running a fork of the next version of aws-xray-sdk-java to get this functionality, and I can confirm that this works with that version.

@Morras Morras closed this as completed Mar 5, 2021
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

No branches or pull requests

2 participants