This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
Context propagation should happen on all traces, even ones that are not sampled, so downstream services know to not sample their portion of the workflow too.
This isn't happening with OpenTelemetry.Instrumentation.AWS. E.g. SQS messages from an operation won't get the traceparent message attribute if that operation isn't sampled.
Component
OpenTelemetry.Instrumentation.AWS
Package Version
Runtime Version
net9.0
Description
Context propagation should happen on all traces, even ones that are not sampled, so downstream services know to not sample their portion of the workflow too.
This isn't happening with OpenTelemetry.Instrumentation.AWS. E.g. SQS messages from an operation won't get the traceparent message attribute if that operation isn't sampled.
Steps to Reproduce
Expected Result
We see a "traceparent" attribute in the message for all messages regardless of sampling decision, with console output like this:
Notice the "00" suffix in the first traceparent value, indicating that it's not sampled
Actual Result
We don't see message attributes on requests that are not sampled. Console output is like this:
Additional Context
.NET doesn't really make it easy to propagate context on traces that are not sampled. (
HttpClient
has its own complex logic to deal with this)There is discussion on this general problem here: https://github.com/open-telemetry/opentelemetry-dotnet/issues/2887
I've added my thoughts on the best practice pattern here, with reference to a sample app in opentelemetry-dotnet: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/examples/MicroserviceExample