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 2644effee3..2040874e36 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -185,11 +185,6 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A Note: The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change. -Internal HTTP spans -***************************** -Internal HTTP send and receive spans are added by default. These can optionally be excluded by setting the boolean environment variables -``OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN`` and ``OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN`` to ``true``. - API --- """ @@ -200,7 +195,6 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A import typing import urllib from collections import defaultdict -from distutils.util import strtobool from functools import wraps from timeit import default_timer 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 _set_http_user_agent, _set_status, ) -from opentelemetry.instrumentation.asgi.environment_variables import ( - OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN, - OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN, -) from opentelemetry.instrumentation.asgi.types import ( ClientRequestHook, ClientResponseHook, @@ -666,12 +656,8 @@ def __init__( ) or [] ) - self.exclude_receive_span = exclude_receive_span or strtobool( - os.getenv(OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN, "false") - ) - self.exclude_send_span = exclude_send_span or strtobool( - os.getenv(OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN, "false") - ) + self.exclude_receive_span = exclude_receive_span + self.exclude_send_span = exclude_send_span # pylint: disable=too-many-statements async def __call__( diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/environment_variables.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/environment_variables.py deleted file mode 100644 index 3d9b435ce9..0000000000 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/environment_variables.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Exclude the http send span from the tracing feature in Python. -""" - -OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN = "OTEL_PYTHON_ASGI_EXCLUDE_SEND_SPAN" - -""" -Exclude the http receive span from the tracing feature in Python. -""" -OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN = "OTEL_PYTHON_ASGI_EXCLUDE_RECEIVE_SPAN"