From a0b4c4f0f92eb065f484f6ec392ed335b2d767e6 Mon Sep 17 00:00:00 2001 From: Hasier Date: Thu, 10 Nov 2022 11:48:50 +0000 Subject: [PATCH] Fix generating ASGI keys --- .../src/opentelemetry/instrumentation/asgi/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 608aeade7f..46bad6672c 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -260,7 +260,8 @@ def get( return decoded def keys(self, carrier: dict) -> typing.List[str]: - return [_key.decode("utf8") for (_key, _value) in carrier] + headers = carrier.get("headers") or [] + return [_key.decode("utf8") for (_key, _value) in headers] asgi_getter = ASGIGetter()