Skip to content

Commit

Permalink
refactor: remove environment variables for internal span toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
omgitsaheadcrab committed Aug 19, 2024
1 parent 90943e9 commit 2073d2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
"""
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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__(
Expand Down

This file was deleted.

0 comments on commit 2073d2a

Please sign in to comment.