-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: include streaming procedure errors in traces (#121)
Why === Streaming response procedures don't raise errors like the other procedures, instead the errors are included in the `AsyncIterator`. Also fixes issues with using contextvars + async generators. What changed ============ - Check if the message from the async iterator is a `RiverError`, if so, record it on the span - Use `start_span` instead of `start_as_current_span`, the latter resets a contextvar in its `finally` clause which is invalid to do for async generators as the async generator's finalizers run in a different context - Thread the span through manually so we still propagate the tracing info Test plan ========= - Should see errors for failed streaming procedures - Logs about resetting contextvars in a different context should go away - Added some tests for the otel stuff to make sure the error handling works here
- Loading branch information
Showing
8 changed files
with
247 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.