opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Is there a way to let trace exporter to export all the spans to OTel agent/collector regardless of the sampled flag in the spans' are 0/1 and let OTel agent/collector to make the decision based on the spans' sampled flag?

Open wdengw opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. Is there a way to let trace exporter to export all the spans to OTel agent/collector regardless of the sampled flag in the spans' are 0/1 and let OTel agent/collector to make the decision based on the spans' Sampled flag?

Describe the solution you'd like The SDK allows all spans to be exported to OTel Agent/Collector with its Sampled flag, so that The OTel agent/collector can receive 100% of the spans created by the app. This opens the opportunity for OTel Agent/Collector's processors opportunity to gather information from all spans and it can decided to store the spans to backend store based the spans' sampled flag.

Describe alternatives you've considered

Additional context In SdkSpanBuilder.startSpan() PropagatedSpan is created when Span is not sampled, resulting in the span not being exported.

Also, OTel's trace.proto don't have fields to pass the sample flag to OTel agent/collector.

wdengw avatar Nov 26 '22 00:11 wdengw

This would need to be added to the specification if we were to implement it in Java. Please raise this as an issue in the specification repository. Thanks!

jkwatson avatar Nov 26 '22 02:11 jkwatson

@jkwatson FYI, https://github.com/open-telemetry/opentelemetry-specification/issues/2986

wdengw avatar Nov 26 '22 04:11 wdengw

Related to #4467.

jack-berg avatar Nov 30 '23 22:11 jack-berg