File tree Expand file tree Collapse file tree
sentry_sdk/integrations/django Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -645,8 +645,13 @@ def execute(
645645 _set_db_data (span , self )
646646 result = real_execute (self , sql , params )
647647
648- with capture_internal_exceptions ():
649- add_query_source (span )
648+ if isinstance (span , StreamedSpan ):
649+ with capture_internal_exceptions ():
650+ add_query_source (span )
651+
652+ if not isinstance (span , StreamedSpan ):
653+ with capture_internal_exceptions ():
654+ add_query_source (span )
650655
651656 return result
652657
@@ -666,8 +671,13 @@ def executemany(
666671
667672 result = real_executemany (self , sql , param_list )
668673
669- with capture_internal_exceptions ():
670- add_query_source (span )
674+ if isinstance (span , StreamedSpan ):
675+ with capture_internal_exceptions ():
676+ add_query_source (span )
677+
678+ if not isinstance (span , StreamedSpan ):
679+ with capture_internal_exceptions ():
680+ add_query_source (span )
671681
672682 return result
673683
You can’t perform that action at this time.
0 commit comments