You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments