Skip to content

Commit 866cedd

Browse files
committed
fix ExcludeList or str
1 parent 7ec4b9a commit 866cedd

File tree

1 file changed

+3
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi

1 file changed

+3
-2
lines changed

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
254254
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS,
255255
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST,
256256
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE,
257+
ExcludeList,
257258
SanitizeValue,
258259
_parse_url_query,
259260
get_custom_headers,
@@ -538,7 +539,7 @@ class OpenTelemetryMiddleware:
538539
def __init__(
539540
self,
540541
app,
541-
excluded_urls=None,
542+
excluded_urls: ExcludeList | str | None = None,
542543
default_span_details=None,
543544
server_request_hook: ServerRequestHook = None,
544545
client_request_hook: ClientRequestHook = None,
@@ -620,7 +621,7 @@ def __init__(
620621
self.active_requests_counter = create_http_server_active_requests(
621622
self.meter
622623
)
623-
if excluded_urls is not None:
624+
if isinstance(excluded_urls, str):
624625
excluded_urls = parse_excluded_urls(excluded_urls)
625626
self.excluded_urls = excluded_urls
626627
self.default_span_details = (

0 commit comments

Comments
 (0)