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 Redshift active record adapter #3032

Merged
merged 6 commits into from
Jan 24, 2025
Merged

Conversation

tannalynn
Copy link
Contributor

@tannalynn tannalynn commented Jan 23, 2025

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

database = config && config[:database]
end
rescue
NewRelic::Agent.logger.debug("Failed to retrieve ActiveRecord host port and database details for adapter: #{config && config[:adapter]}")
Copy link
Contributor Author

@tannalynn tannalynn Jan 23, 2025

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)

@tannalynn tannalynn marked this pull request as ready for review January 23, 2025 22:13
Copy link
Contributor

@kaylareopelle kaylareopelle left a 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!

CHANGELOG.md Outdated Show resolved Hide resolved
hannahramadan
hannahramadan previously approved these changes Jan 23, 2025
Co-authored-by: Kayla Reopelle <[email protected]>
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.58% 93%

@tannalynn tannalynn merged commit b42351c into dev Jan 24, 2025
38 checks passed
@tannalynn tannalynn deleted the redshift_active_record_adapter branch January 24, 2025 16:44
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.

Add instrumentation and entity relationship support for AWS_REDSHIFT_CLUSTER
3 participants