Skip to content

Conversation

@nikhilwoodruff
Copy link
Contributor

Spans were being marked as incomplete in Logfire because force_flush() was called while the span was still open. The finally block was inside the with logfire.span(...) context, so the span hadn't closed yet when flush happened.

Fixed by wrapping the entire with logfire.span(...) in an outer try/finally so force_flush() runs after the span closes.

@nikhilwoodruff nikhilwoodruff merged commit 9d3bf6c into main Jan 2, 2026
1 check passed
@nikhilwoodruff nikhilwoodruff deleted the fix-incomplete-spans branch January 2, 2026 20:32
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.

2 participants