@@ -185,11 +185,6 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
185
185
Note:
186
186
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
187
187
188
- Internal HTTP spans
189
- *****************************
190
- Internal HTTP send and receive spans are added by default. These can optionally be excluded by setting the boolean environment variables
191
- ``OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN`` and ``OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN`` to ``true``.
192
-
193
188
API
194
189
---
195
190
"""
@@ -200,7 +195,6 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
200
195
import typing
201
196
import urllib
202
197
from collections import defaultdict
203
- from distutils .util import strtobool
204
198
from functools import wraps
205
199
from timeit import default_timer
206
200
from typing import Any , Awaitable , Callable , DefaultDict , Tuple
@@ -233,10 +227,6 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
233
227
_set_http_user_agent ,
234
228
_set_status ,
235
229
)
236
- from opentelemetry .instrumentation .asgi .environment_variables import (
237
- OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN ,
238
- OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN ,
239
- )
240
230
from opentelemetry .instrumentation .asgi .types import (
241
231
ClientRequestHook ,
242
232
ClientResponseHook ,
@@ -666,12 +656,8 @@ def __init__(
666
656
)
667
657
or []
668
658
)
669
- self .exclude_receive_span = exclude_receive_span or strtobool (
670
- os .getenv (OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN , "false" )
671
- )
672
- self .exclude_send_span = exclude_send_span or strtobool (
673
- os .getenv (OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN , "false" )
674
- )
659
+ self .exclude_receive_span = exclude_receive_span
660
+ self .exclude_send_span = exclude_send_span
675
661
676
662
# pylint: disable=too-many-statements
677
663
async def __call__ (
0 commit comments