Skip to content

Add "multi" methods instrumentation for Rails cache integration - #1217

Merged
marcotc merged 1 commit into
DataDog:masterfrom
michaelkl:feat/rails-cache-multi
Oct 28, 2020
Merged

Add "multi" methods instrumentation for Rails cache integration#1217
marcotc merged 1 commit into
DataDog:masterfrom
michaelkl:feat/rails-cache-multi

Conversation

@michaelkl

Copy link
Copy Markdown
Contributor

In current implementation only read, write and fetch methods of ActiveSupport::Cache::Store are instrumented. This PR adds the instrumentation of read_multi, write_multi and fetch_multi methods.

image
image

@michaelkl
michaelkl requested a review from a team October 22, 2020 19:22
@michaelkl
michaelkl marked this pull request as draft October 22, 2020 19:31
@michaelkl
michaelkl force-pushed the feat/rails-cache-multi branch 2 times, most recently from 746d934 to b546cc9 Compare October 23, 2020 12:12
@ericmustin

Copy link
Copy Markdown
Contributor

👋 @michaelkl thanks for the contribution! Generally this looks like a really solid addition to the library. I am a bit backlogged right now but should be able to give this a thoughtful review in the coming days, I want to review how some other libraries and languages handle multi read/write/fetch operations, But i think the approach here makes sense.

Also, for the linting failed tests, bundle exec rake rubocop from the root of the dd-trace-rb aught to surface any linting issues

@michaelkl
michaelkl force-pushed the feat/rails-cache-multi branch from b546cc9 to 4516f85 Compare October 23, 2020 12:20
@michaelkl

Copy link
Copy Markdown
Contributor Author

Thank you @ericmustin ! Glad to help the community!
I tried to follow the same approach already used for existing cache operations.

I will remove the Draft status from the PR when it turns out ready to be reviewed. Take your time, no rush at all!

@michaelkl
michaelkl force-pushed the feat/rails-cache-multi branch 2 times, most recently from d8403dd to 84ebc85 Compare October 23, 2020 12:47
@michaelkl
michaelkl marked this pull request as ready for review October 23, 2020 13:02

@marcotc marcotc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @michaelkl! I left a few suggestion on my review, but it looks very close to completion. Great job on getting it to pass tests on all (even very old) versions of Rails 👍

Comment thread lib/ddtrace/contrib/active_support/cache/instrumentation.rb Outdated
Comment thread lib/ddtrace/contrib/active_support/cache/instrumentation.rb Outdated
@marcotc marcotc added community Was opened by a community member feature Involves a product feature integrations Involves tracing integrations labels Oct 26, 2020
@michaelkl
michaelkl force-pushed the feat/rails-cache-multi branch from 84ebc85 to 0a08188 Compare October 27, 2020 06:22

@marcotc marcotc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, @michaelkl! 🚀

@marcotc
marcotc merged commit 220c6fa into DataDog:master Oct 28, 2020
@marcotc marcotc added this to the 0.43.0 milestone Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Was opened by a community member feature Involves a product feature integrations Involves tracing integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants