From 6fbdcbe0540955079ef899d511502a056401ea9e Mon Sep 17 00:00:00 2001 From: 5cat Date: Sun, 10 Sep 2023 16:58:54 +0800 Subject: [PATCH] return empty map when headers does not exist --- .../lib/opentelemetry/instrumentation/bunny/patch_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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?