-
-
Notifications
You must be signed in to change notification settings - Fork 521
fix(rails): fix logging of cached queries with binds #2789
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
fix(rails): fix logging of cached queries with binds #2789
Conversation
3d2857a to
afd6b90
Compare
| binds = event.payload[:binds] | ||
|
|
||
| if Sentry.configuration.send_default_pii && binds&.any? | ||
| if Sentry.configuration.send_default_pii && (binds && !binds.empty?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More verbose but actually faster
| # When a query is cached, binds are a callable, | ||
| # and under JRuby they're always a callable. | ||
| if binds.respond_to?(:call) | ||
| binds.call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does that mean in the cached case, we will incur extra overhead to fetch the binds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sl0thentr0py a bit, but it's hard to tell what the impact is w/o measuring it. Want me to check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sl0thentr0py we good amigo 😄

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for checking!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for checking!
Fixes #2785