diff --git a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb index 4cb67b884..e41a65d63 100644 --- a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb +++ b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb @@ -37,7 +37,7 @@ def self.extract_context(properties) parent_context = OpenTelemetry.propagation.extract(properties[:tracer_receive_headers]) # link to the producer context - producer_context = OpenTelemetry.propagation.extract(properties[:headers]) + 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?