-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redis.exception.WatchError
is not really an error
#2639
Comments
Yeah, makes sense. |
May I take this one? |
@Charlie-lizhihan sure |
Hi, @xrmx @chrisguidry
My idea is to change the The updated span will looks like
Does this sounds good? |
That sounds perfect to me! Thank you for taking this one on |
@chrisguidry, would you care to give it a try with the fix from #2668? |
Will do, likely a little later this week |
Hi @emdneto I tested and left a note on the PR, I believe we're swallowing the error, but we should really be re-raising it |
In open-telemetry#2668, we started to avoid having the `redis.WatchError` mark the span as having failed, but we were inadvertently suppressing that exception from the calling code. `redis.WatchError` is used for flow-of-control concurrency in many applications, and applications depend on catching the error to handle concurrent changes to keys during redis pipelines. This re-raises the `WatchError` to keep the instrumentation transparent to the application. Fixes open-telemetry#2639
In open-telemetry#2668, we started to avoid having the `redis.WatchError` mark the span as having failed, but we were inadvertently suppressing that exception from the calling code. `redis.WatchError` is used for flow-of-control concurrency in many applications, and applications depend on catching the error to handle concurrent changes to keys during redis pipelines. This re-raises the `WatchError` to keep the instrumentation transparent to the application. Fixes open-telemetry#2639
What problem do you want to solve?
When upgrading
opentelemetry-instrumentation-redis
from 0.39b0 to 0.46b0, we picked up the (very nice) fixes to instrumentation of the async redis client. However, all of ourarq
(https://github.com/samuelcolvin/arq/) workers started marking tons of traces as errors because they got aWatchError
exception.The
redis
WatchError
is not really an error, it's a flow-control and concurrency-management mechanism (kind of like aLockError
, etc). The fact that we're marking all of those spans as errored introduces a lot of noise to something that's a totally reasonable pattern and use of redis.Here's an example of how it's used for concurrency control: https://github.com/samuelcolvin/arq/blob/main/arq/connections.py#L178C20-L180
Describe the solution you'd like
I'd recommend that we adjust the instrumentation to not mark spans as failed when they encounter
WatchError
(or to at least make this behavior configurable). It does make sense to still mark them as events on the current span, though.Describe alternatives you've considered
No response
Additional Context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: