-
Notifications
You must be signed in to change notification settings - Fork 600
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 Redshift active record adapter #3032
Conversation
database = config && config[:database] | ||
end | ||
rescue | ||
NewRelic::Agent.logger.debug("Failed to retrieve ActiveRecord host port and database details for adapter: #{config && config[:adapter]}") |
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.
I added this rescue here just for extra safety.
I don't think redshift adapters are going to have issues with this, BUT it's also possible people might DIY a redshift adapter, plus there is no way for us to test them all bc there are a lot. So I added this rescue and log message so if an adapter does cause problems, it won't prevent the segment from being created below, it'll simply be missing the info it wasn't able to grab. (and it would have been missing that info anyways since redshift wasn't previously on the adapter list)
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.
Few lil wording things, but other than that looks great!
lib/new_relic/agent/instrumentation/active_record_subscriber.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Kayla Reopelle <[email protected]>
Co-authored-by: Kayla Reopelle <[email protected]>
SimpleCov Report
|
We won't record host, port or db name info unless we recognize the adapter. Also for redshift, regular activerecord doesnt work, so you need to use some other gem for a redshift adapter (it looks like there are quite a lot of these for each rails version). It seems pretty consistently to be named redshift on the adapter in those gems though it seems, on the ones i saw at least.
This is the gem i used in my testing https://github.com/pennylane-hq/activerecord-adapter-redshift
closes #2900