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 545437c2ef..6e0f31b9b2 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -149,7 +149,9 @@ def get_default_span_details(scope: dict) -> Tuple[str, dict]: Returns: a tuple of the span name, and any attributes to attach to the span. """ - span_name = scope.get("path") or "HTTP {}".format(scope.get("method", "").strip()) + span_name = scope.get("path", "").strip() or "HTTP {}".format( + scope.get("method", "").strip() + ) return span_name, {}