lib/opentelemetry/instrumentation/bunny/patch_helpers.rb in opentelemetry-instrumentation-bunny-0.21.0 vs lib/opentelemetry/instrumentation/bunny/patch_helpers.rb in opentelemetry-instrumentation-bunny-0.21.1
- old
+ new
@@ -33,9 +33,10 @@
end
def self.extract_context(properties)
# use the receive span as parent context
parent_context = OpenTelemetry.propagation.extract(properties[:tracer_receive_headers])
+ return [parent_context, nil] if properties[:headers].nil?
# link to the producer context
producer_context = OpenTelemetry.propagation.extract(properties[:headers])
producer_span_context = OpenTelemetry::Trace.current_span(producer_context).context
links = [OpenTelemetry::Trace::Link.new(producer_span_context)] if producer_span_context.valid?