Skip to content

Commit bf8919a

Browse files
committedNov 8, 2023
End span on exception or other premature exits
1 parent faac707 commit bf8919a

File tree

1 file changed

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

1 file changed

+2
-0
lines changed
 

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

+2
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ async def __call__(self, scope, receive, send):
630630
)
631631
if token:
632632
context.detach(token)
633+
if span.is_recording():
634+
span.end()
633635

634636
# pylint: enable=too-many-branches
635637

0 commit comments

Comments
 (0)