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

Fix key in cache instrumentation for Rails 7.2 #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

skipkayhil
Copy link

Previously, the key being logged in cache instrumentation would always be normalized by the instrumenter. However, many cache methods did not pass all of the options necessary to normalize a key into the instrumenter and so the key would not always reflect the actual key used in the cache.

In rails/rails@9af99bf, the instrumenter was updated to no longer normalize the key because of this inconsistency. Now the caller of the instrument method is expected to pass the normalized key instead of the pre-normalized key.

To maintain compatibility with Rails both before and after this commit, The key passed into instrument is conditional based on the Rails version, and the conditional can eventually be removed once Rails 7.2 is the minimum supported version

Previously, the key being logged in cache instrumentation would always
be normalized by the instrumenter. However, many cache methods did not
pass all of the options necessary to normalize a key into the
instrumenter and so the key would not always reflect the actual key used
in the cache.

In rails/rails@9af99bf, the
instrumenter was updated to no longer normalize the key because of this
inconsistency. Now the caller of the instrument method is expected to
pass the normalized key instead of the pre-normalized key.

To maintain compatibility with Rails both before and after this commit,
The key passed into instrument is conditional based on the Rails
version, and the conditional can eventually be removed once Rails 7.2 is
the minimum supported version

Co-authored-by: Nick Schwaderer <[email protected]>
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.

2 participants