AWS XRay expects traceIds to be in a specific format. Otel SDK allows customizing id generation. Please consider extending OpenTelemetryAutoConfiguration.otelSdkTracerProvider() to support overriding this.

Something like:

// depends on io.opentelemetry.contrib:opentelemetry-aws-xray:1.23.0
SdkTracerProvider.builder().setIdGenerator(AwsXrayIdGenerator.getInstance())...

Comment From: vpavic

I agree that this is a bit of a pain, as it requires users to provide a configuration with a custom SdkTracerProvider and also manually configure several other dependent components.

I've opened #35041 to consider some improvements here.

Comment From: quaff

It's covered by https://github.com/spring-projects/spring-boot/pull/34945

Comment From: jonatan-ivanov

@gnagy Thank you for opening the issue, it seems we have two PRs to resolve this so I'm closing this in favor of (probably) https://github.com/spring-projects/spring-boot/pull/34945.

Also, you might want to give some feedback to Amazon (maybe in the form of an issue) that X-Ray natively supporting standard headers (w3c) has some user interest.

Comment From: gnagy

Thanks @jonatan-ivanov , #34945 looks better 👍

Do you mean X-Ray supporting standard headers as in not needing a custom ID generator, or standard header names?

If the former, AFAIK the reason for custom X-Ray id format is that they encode the timestamp in the trace ID so they can performantly drop too old data in a stateless way on ingress.

If the latter, their recommended approach is to process headers in the collector agent (aws-otel-collector), so no need to change apps for that.

Comment From: jonatan-ivanov

Kind of both: supporting the w3c standard would mean both the format and the header name.

Unfortunately the agent approach has many issues but I don't see too high chance of AWS supporting the w3c standard.