File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ def _should_be_included(
231231
232232
233233def add_source (
234- span : Union [" sentry_sdk.tracing.Span" , " sentry_sdk.traces.StreamedSpan" ] ,
234+ span : " Union[sentry_sdk.tracing.Span, sentry_sdk.traces.StreamedSpan]" ,
235235 project_root : "Optional[str]" ,
236236 in_app_include : "Optional[list[str]]" ,
237237 in_app_exclude : "Optional[list[str]]" ,
@@ -367,10 +367,10 @@ def add_http_request_source_for_streamed_span(
367367 if not should_add_request_source :
368368 return
369369
370- try :
370+ if span . start_timestamp_monotonic_ns is not None :
371371 elapsed = nanosecond_time () - span .start_timestamp_monotonic_ns
372372 end_timestamp = span .start_timestamp + timedelta (microseconds = elapsed / 1000 )
373- except ( AttributeError , TypeError ) :
373+ else :
374374 end_timestamp = datetime .now (timezone .utc )
375375
376376 duration = end_timestamp - span .start_timestamp
You can’t perform that action at this time.
0 commit comments