Update SpanProcessors to be invoked in order they are registered #1195
Labels
area:trace
Part of OpenTelemetry tracing
help wanted
Extra attention is needed
pkg:SDK
Related to an SDK package
Milestone
Currently a TracerProvicer stores known SpanProcessors in a map:
opentelemetry-go/sdk/trace/span_processor.go
Line 46 in 038f505
When a span is started or finished it iterates through the map and invokes the associated method of the SpanProcessor:
opentelemetry-go/sdk/trace/tracer.go
Lines 62 to 64 in 038f505
opentelemetry-go/sdk/trace/span.go
Lines 151 to 153 in 038f505
The specification specifies this execution to be ordered:
Based on a recent issue it was made clear that this hasn't had any real effect because there is no direct linking between registered SpanProcessors. However, we should update the execution model and conform to the specified behaviour so we are compliant.
This will likely require changing the underlying spanProcessorMap type. It will need to still provide getter/setter functionality as the existing map does so the TracerProvider can correctly unregister any SpanProcessor, but it will need to also track order.
The text was updated successfully, but these errors were encountered: