opentelemetry-java-contrib
opentelemetry-java-contrib copied to clipboard
Allow to use AWS X-Ray id generator with auto-instrumentation Java agent
Component(s)
aws-xray
Is your feature request related to a problem? Please describe.
OpenTelemetry provides an AwsXrayIdGenerator, but there is no easy way to start using it with auto-instrumentation Java agent.
Describe the solution you'd like
Have a custom AutoConfigurationCustomizerProvider that sets the generator depending on some configuration flag (e.g. otel.aws-xray.trace-id-generator.enabled or something) in the aws-xray module.
Describe alternatives you've considered
You can set a custom IdGenerator by implementing a custom extension that will use the AutoConfigurationCustomizerProvider SPI to modify the SdkTracerProviderBuilder via the AutoConfigurationCustomizer#addTracerProviderCustomizer() method.
It is a rather complicated solution that requires some insights into OpenTelemetry Java instrumentation process.
Additional context
No response
Related discussion: https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/8790 Ping @wangzlei @srprash