|
2 | 2 | from aiohttp import web
|
3 | 3 | from multidict import CIMultiDictProxy
|
4 | 4 | from timeit import default_timer
|
5 |
| -from typing import Tuple, Dict, List |
| 5 | +from typing import Tuple, Dict, List, Union |
6 | 6 |
|
7 | 7 | from opentelemetry import context, trace, metrics
|
8 | 8 | from opentelemetry.instrumentation.aiohttp_server.package import _instruments
|
@@ -148,16 +148,16 @@ def set_status_code(span, status_code):
|
148 | 148 | class AiohttpGetter(Getter):
|
149 | 149 | """Extract current trace from headers"""
|
150 | 150 |
|
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 |
153 | 153 | scope.
|
154 | 154 |
|
155 | 155 | Args:
|
156 | 156 | carrier: ASGI scope object
|
157 | 157 | key: header name in scope
|
158 | 158 | 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. |
161 | 161 | """
|
162 | 162 | headers: CIMultiDictProxy = carrier.headers
|
163 | 163 | if not headers:
|
|
0 commit comments