Skip to content

Commit 9a551b1

Browse files
committed
Fixes some typos and add more typing to the code.
1 parent e235e7e commit 9a551b1

File tree

1 file changed

+5
-5
lines changed
  • instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server

1 file changed

+5
-5
lines changed

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from aiohttp import web
33
from multidict import CIMultiDictProxy
44
from timeit import default_timer
5-
from typing import Tuple, Dict, List
5+
from typing import Tuple, Dict, List, Union
66

77
from opentelemetry import context, trace, metrics
88
from opentelemetry.instrumentation.aiohttp_server.package import _instruments
@@ -148,16 +148,16 @@ def set_status_code(span, status_code):
148148
class AiohttpGetter(Getter):
149149
"""Extract current trace from headers"""
150150

151-
def get(self, carrier, key: str):
152-
"""Getter implementation to retrieve a HTTP header value from the ASGI
151+
def get(self, carrier, key: str) -> Union[List, None]:
152+
"""Getter implementation to retrieve an HTTP header value from the ASGI
153153
scope.
154154
155155
Args:
156156
carrier: ASGI scope object
157157
key: header name in scope
158158
Returns:
159-
A list with a single string with the header value if it exists,
160-
else None.
159+
A list of all header values matching the key, or None if the key
160+
does not match any header.
161161
"""
162162
headers: CIMultiDictProxy = carrier.headers
163163
if not headers:

0 commit comments

Comments
 (0)