Description
Is your feature request related to a problem? Please describe.
Java does not have a good mechanism for modifying environment variables. There are some hacky solutions which use Reflection API, and modify the UnmodifiableMap which holds the variables. This technique is now discouraged by Oracle. Good reads on this topic: blog post by Oracle
Because of this, setting tracing information via _X_AMZN_TRACE_ID
is challenging in new versions of Java, even with the hack.
Would it be possible to implement reading tracing information from a system property, not from an environment variable? aws-x-ray-sdk-java
implemented this some time ago: link
Describe the solution you'd like
Optionally read tracing information from com.amazonaws.xray.traceHeader
system property.
Similarly to this PR: https://github.com/aws/aws-xray-sdk-java/pull/252/files
Additional context
Perhaps, this class should be modified: link