Skip to content
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

The Redis integration can't distinguish final errors from retried errors #3820

Open
byroot opened this issue Aug 1, 2024 · 6 comments
Open
Labels
community Was opened by a community member feature-request A request for a new feature or change to an existing one

Comments

@byroot
Copy link

byroot commented Aug 1, 2024

Ref: redis-rb/redis-client#119

There is a bit of an ongoing problem with users of dd-trace-rb, the instrumentation of the Redis gem has a fairly different behavior whether you are using the 4.x version or 5.x version.

More detail at redis-rb/redis-client#119 (comment), but in short with the 4.x version the instrumentation is hooked above the code in charge of retrying on error, while with 5.x it's below.

Because of this users upgrading from 4.x to 5.x see a stream of errors that aren't new at all, just weren't reported, and think the 5.x version is bugged.

This is no fault of dd-trace-rb, it just use the official hook points declared by redis-client. As the maintainer of redis-client I'd like to find a solution to this, and totally willing to extend or evolve the hook points to allow dd-trace-rb and similar projects to be able to ignore retried errors.

But to help with that I'd first like to know if there is a precedent to this, is this done for other integrations? Would dd-trace-rb need to just not see errors, or need some kind of boolean telling whether the error is final, etc. As this would help me drive what the API change would look like.

@ivoanjo @TonyCTHsu please let me know your thougths.

@byroot byroot added community Was opened by a community member feature-request A request for a new feature or change to an existing one labels Aug 1, 2024
@byroot byroot changed the title The Redis integration can't distinguish final errors from final errors The Redis integration can't distinguish final errors from retried errors Aug 1, 2024
@ivoanjo
Copy link
Member

ivoanjo commented Aug 1, 2024

Thanks for letting us know, definitely sucks that we're breaking folks and adding more work for you 😅

Let me sync with the other folks and we'll get back to you asap.

@byroot
Copy link
Author

byroot commented Aug 1, 2024

definitely sucks that we're breaking folks and adding more work for you

It really isn't that bad, it's mostly confusion I think.

@marcotc
Copy link
Member

marcotc commented Aug 7, 2024

Just an FYW that we are still looking into it; just trying to get the right people together with all the summer PTOs.

@byroot
Copy link
Author

byroot commented Aug 7, 2024

No worries. That's much appreciated.

@marcotc
Copy link
Member

marcotc commented Aug 21, 2024

Hey @byroot, I had a chat internally in Hughes what we came up with:

  1. We think that visibility at a level that abstracts away any automatic retries is the desirable default. We had this behavior when we instrumented version 4.x, but we made a mistake of changing that behavior for 5.X.
  2. Inspecting the middleware call site today, we think that it makes sense that it is invoked on each individual request, even on retried request, because arbitrary request modifications can be necessary on an individual request level. For observability, we are not interested in that signal, but we see the value in theory.

What we re thinking of doing is going back to the original monkey-patching for 5.x, that same that we do for 4.x.

We don't think that is necessarily required for the redis-client gem to support callbacks at the level we desire which today would translate to "one high-level Redis API call to one instrumentation signal".

We are happy to expand a conversation as well and hear any feedback.

@byroot
Copy link
Author

byroot commented Aug 21, 2024

What we re thinking of doing is going back to the original monkey-patching for 5.x, that same that we do for 4.x.

So you wouldn't instrument raw redis-client usage at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Was opened by a community member feature-request A request for a new feature or change to an existing one
Projects
None yet
Development

No branches or pull requests

3 participants