Skip to content

fix(otel): fix continuation span start time#542

Merged
nvasiu merged 2 commits into
mainfrom
fix-otel-continuation-span-start-time
Jul 17, 2026
Merged

fix(otel): fix continuation span start time#542
nvasiu merged 2 commits into
mainfrom
fix-otel-continuation-span-start-time

Conversation

@nvasiu

@nvasiu nvasiu commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

N/A

Description of changes:

Update the continuation span's start time to use the operation's start time.

Current behaviour:

When on_operation_end continues a span from a previous invocation, it creates a span with start_time = datetime.now(). But the span's end time is set to the end_time recorded in the operation info.

If an operation quickly finishes before the span is started, end_time will be before the datetime.now() call, resulting in a negative span duration.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

SilanHe
SilanHe previously approved these changes Jul 16, 2026
@SilanHe

SilanHe commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

can you merge after the tests pass?

@zhongkechen

Copy link
Copy Markdown
Contributor

Can we have a case assert on the start time?

zhongkechen
zhongkechen previously approved these changes Jul 17, 2026
@nvasiu
nvasiu dismissed stale reviews from zhongkechen and SilanHe via 2b429b9 July 17, 2026 16:48
@nvasiu
nvasiu force-pushed the fix-otel-continuation-span-start-time branch from bc5d2d9 to 2b429b9 Compare July 17, 2026 16:48
@nvasiu
nvasiu merged commit edefc2d into main Jul 17, 2026
12 checks passed
@nvasiu
nvasiu deleted the fix-otel-continuation-span-start-time branch July 17, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants