-
Notifications
You must be signed in to change notification settings - Fork 375
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
fixes #630 potential performance hit logging cache key #635
fixes #630 potential performance hit logging cache key #635
Conversation
* using ActiveSupport::Cache.expand_cache_key which is also used by Rails to expand the cache key without enumerating relations
@delner I looked into this, and this seems like the most straightforward way to work around it, since it's anyway used inside Rails. I was trying to write a test for it, but somehow couldn't get tests running using docker-compose. I'm not sure exactly why. I had all containers running, and then using bash inside the tracer container I ran
|
On a side note, it seems to me like the ddtracer patches ActiveSupport in order to trace cache reads, writes, etc. But wouldn't be more elegant to use the built-in rails instrumentation for that? https://edgeguides.rubyonrails.org/active_support_instrumentation.html#active-support |
@gingerlime On the tests, you almost had it right with |
cd65753
to
280af3d
Compare
@delner I added a couple of simple tests, and CI looks green (apart from what looks like an unrelated failure). Regardless, I'm curious to hear your thoughts about #635 (comment) ... |
@gingerlime Honest answer as to why we don't use the ActiveSupport hooks: I don't know. It might be because we support Rails versions as old as 3.0 and this doesn't exist in those older versions, or that we simply didn't see that event when the integration was created. If a PR was created to use that instrumentation hook, and it was implemented in a way such that it passes our test suite, I would seriously consider merging it. I don't know if we'd get around to writing such a refactor soon otherwise; we'd likely add it to the backlog instead. |
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.
Looks good, thanks @gingerlime ! 👍
used by Rails to expand the cache key without enumerating
relations