| Status | |
|---|---|
| Stability | Stable |
| Code Owners | @srprash, @normj |
If you want to send the traces to AWS X-Ray, you can do so by using AWS Distro with the OpenTelemetry SDK.
The OpenTelemetry SDK generates traces with W3C random ID which X-Ray
backend doesn't currently support. You need to install the
OpenTelemetry.Extensions.AWS to be able to use the
AWS X-Ray id generator which generates X-Ray compatible trace IDs.
If you plan to call another application instrumented with AWS X-Ray SDK,
you'll need to configure the AWS X-Ray propagator as well.
dotnet add package OpenTelemetry.Extensions.AWSConfigure AWS X-Ray ID generator and propagator globally in your
application as follows. Make sure to call AddXRayTraceId() in the
very beginning when creating TracerProvider.
using OpenTelemetry;
using OpenTelemetry.Extensions.AWS.Trace;
using OpenTelemetry.Trace;
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddXRayTraceId()
// other instrumentations
...
.Build();
Sdk.SetDefaultTextMapPropagator(new AWSXRayPropagator());