[bug] AWS instrumentation not adding request specific info on requests *not* sampled #2345
Labels
bug
Something isn't working
comp:instrumentation.aws
Things related to OpenTelemetry.Instrumentation.AWS
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:
open-telemetry/opentelemetry-dotnet#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
The text was updated successfully, but these errors were encountered: