Skip to content

Commit 8d0b013

Browse files
committed
another batch of fixes
1 parent 1c8da4f commit 8d0b013

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

sentry_sdk/integrations/graphene.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def graphql_span(
154154
if operation_name:
155155
_graphql_span.set_attribute("graphql.operation.name", operation_name)
156156
_graphql_span.set_attribute("graphql.operation.type", operation_type)
157+
_graphql_span.start()
157158
else:
158159
_graphql_span = sentry_sdk.start_span(op=op, name=operation_name)
159160
_graphql_span.set_data("graphql.document", source)
@@ -163,4 +164,7 @@ def graphql_span(
163164
try:
164165
yield
165166
finally:
166-
_graphql_span.finish()
167+
if isinstance(_graphql_span, StreamedSpan):
168+
_graphql_span.end()
169+
else:
170+
_graphql_span.finish()

sentry_sdk/integrations/stdlib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ def getresponse(self: "HTTPConnection", *args: "Any", **kwargs: "Any") -> "Any":
180180
else:
181181
span.set_data("reason", rv.reason)
182182
finally:
183-
span.finish()
183+
if isinstance(span, StreamedSpan):
184+
span.end()
185+
else:
186+
span.finish()
184187

185188
with capture_internal_exceptions():
186189
add_http_request_source(span)

0 commit comments

Comments
 (0)