opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

Allow to use AWS X-Ray id generator with auto-instrumentation Java agent

Open vmihailenco opened this issue 2 years ago • 2 comments

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

vmihailenco avatar Jun 23 '23 10:06 vmihailenco

Related discussion: https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/8790 Ping @wangzlei @srprash

mateuszrzeszutek avatar Jun 23 '23 10:06 mateuszrzeszutek