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

add support for makara database adapters #1177

Merged
merged 1 commit into from
May 26, 2022

Conversation

lucasklaassen
Copy link
Contributor

Overview

This PR adds support for makara database adapters so that proper SQL query obfuscation can be done for the underlying database type. Makara defines its own database adapters for the following databases: mysql2, postgresql, jdbcmysql and jdbcpostgresql. Makara customizes the way ActiveRecord handles it connection pools. Previously, when a makara database connection was being traced by the newrelic gem, it would view it as ActiveRecord and not pick up on the underlying database type. This prevented the ability to utilize the proper SQL query obfuscation rules for any makara adapter database connections.

Related Github Issue

#507

Testing

I've manually confirmed in a local environment that this works for the postgresql_makara adapter.

Reviewer Checklist

  • Perform code review
  • Add performance label
  • Perform appropriate level of performance testing
  • Confirm all checks passed
  • Add version label prior to acceptance

@CLAassistant
Copy link

CLAassistant commented May 19, 2022

CLA assistant check
All committers have signed the CLA.

@fallwith
Copy link
Contributor

Hi @lucasklaassen! Thanks very much for this contribution. This makara support will be great to have. Our team is now back from attending RailsConf and we'll be taking a look at your changes this week.

1 similar comment
@fallwith
Copy link
Contributor

Hi @lucasklaassen! Thanks very much for this contribution. This makara support will be great to have. Our team is now back from attending RailsConf and we'll be taking a look at your changes this week.

@fallwith
Copy link
Contributor

@lucasklaassen we've had a chance to look over your proposed changes and we are very pleased with the solutions you came up with. Nicely done! Getting at the spec config object for makara rather than insisting on locating the Ruby object that matches the connection_id value is a terrific approach. Also, that code is only reachable for Rails versions 5 and below, so it limits well any impact on non-makara systems running Rails 6 or 7. Great.

With #1180, we're riffing on your original concepts a bit. Overall the idea over there is to set up some choke points in the code for all adapter logic to route through. For now those choke points will only apply makara logic, but in future they could be leveraged to support other similar gems that layer in database related content.

With you having signed our CLA and pioneered these great ideas, I'm going to go ahead and merge your PR as is, even though a couple of the individual CLI checks have issues. We'll use #1180 to get the tests fixed up. This should be easier than having you grant us access to your fork or us having you point your PR to a branch. And most importantly, it will add you to our contributors list.

Ideally #1180 will be done soon and the changes will make it into our next release, v8.8.0.

We are grateful for your contribution. If you're ever at a Ruby or Rails conference and see a New Relic presence, please come up and say hi so that we can thank you in person.

@fallwith fallwith merged commit 26fad50 into newrelic:dev May 26, 2022
@lucasklaassen
Copy link
Contributor Author

@fallwith wow thanks for this detailed response and praise! Happy I could contribute and will definitely say hello at the next tech conference 💯

@lucasklaassen lucasklaassen deleted the makara_support branch May 27, 2022 17:58
@lucasklaassen lucasklaassen restored the makara_support branch May 27, 2022 20:21
@fallwith
Copy link
Contributor

fallwith commented Jun 2, 2022

Hi @lucasklaassen, @seanvm, @keltonkowalchuk, @jesstice, and @comberj. These changes that brought in support for Makara are now live on RubyGems.org with version 8.8.0 of the agent. Thanks for giving us something awesome to point to when telling of New Relic's continued adventures in open source land!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants