-
Notifications
You must be signed in to change notification settings - Fork 226
fix: Ensure encoding errors handled during SQL obfuscation for Trilogy #345
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: Ensure encoding errors handled during SQL obfuscation for Trilogy #345
Conversation
This should be supported in the same way as Mysql2's implementation.
…ilogy instrumentation
|
Hey @adrianna-chang-shopify just ack'ing this. This looks good to me but i'll admit i'm very out of touch with Trilogy at the moment, and would appreciate input from @arielvalentin on this. I will try to give this a closer look this evening but seems straightforward imo and appreciate you keeping this instrumentation in line with mysql2 |
instrumentation/mysql2/test/opentelemetry/instrumentation/mysql2/instrumentation_test.rb
Show resolved
Hide resolved
instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb
Show resolved
Hide resolved
instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb
Outdated
Show resolved
Hide resolved
ericmustin
left a comment
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.
lgtm pending @arielvalentin suggested change wrt error handling
instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb
Outdated
Show resolved
Hide resolved
instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb
Outdated
Show resolved
Hide resolved
c82d921 to
deaf871
Compare
deaf871 to
d4a33e0
Compare
robertlaurin
left a comment
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.
LGTM
|
Oops let me just update the CHANGELOG quickly |
The deploy robot will handle that for us, but if you've already updated it that's ok! |
b4fb2c9 to
d4a33e0
Compare
Shopify is planning to start migrating apps from Mysql2 to Trilogy as a SQL database client. Ensuring parity between OpenTelemetry instrumentation for Mysql2 and Trilogy is important before we move to Trilogy.
This PR ensures that invalid byte sequences are handled appropriately when obfuscating SQL, taking inspiration from #160. I also added some additional tests to the Trilogy spec around configuring
db_statementvia an environment variable.I noticed the Mysql2 test around invalid byte encoding was removed in #265 when the
enable_sql_obfuscationconfig went away, and I'm not sure if that was intentional. I've added a test to the Mysql2 spec to ensure there's coverage for an invalid byte sequence appearing in SQL.