Attributes from Samplers not being added to sampled Spans #1228
Labels
area:trace
Part of OpenTelemetry tracing
bug
Something isn't working
pkg:SDK
Related to an SDK package
The sampling section of the Tracing SDK specification specifies that the return value of the ShouldSample method contains "A set of span Attributes that will also be added to the Span.".
When using a custom sampler with the Go SDK, attributes returned from the Sampler are only set on the root Span in a Trace, not on each of the individual spans. I tested with the Python SDK, and in that implementation, Attributes are being set on every span.
The use case we need this for is to be able to set the Sample Rate for each span sent to Honeycomb. Our backend uses the sample rate when calculating aggregate functions on events. Here's the sampler implementation we're using for a proof of concept.
Using this sample app, we get the following output:
On each of the Spans, except to the root span:
Using the Python sample app, I'm able to see the Attribute on every span:
The text was updated successfully, but these errors were encountered: