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

ActiveSupport::Cache (or Rails) will use Rails.configuration.cache_store for "backend" value despite cache type #1252

Closed
zachmccormick opened this issue Nov 17, 2020 · 5 comments
Assignees
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations

Comments

@zachmccormick
Copy link
Contributor

 def finish_trace_cache(payload)
            # retrieve the tracing context and continue the trace
            tracing_context = payload.fetch(:tracing_context)
            span = tracing_context[:dd_cache_span]
            return unless span && !span.finished?
            begin
              # discard parameters from the cache_store configuration
              if defined?(::Rails)
                store, = *Array.wrap(::Rails.configuration.cache_store).flatten
                span.set_tag(Ext::TAG_CACHE_BACKEND, store)
              end
...

the ::Rails.configuration.cache_store bit ignores what store actually is and just sends up Rails' default configuration. This is detrimental to those of us that use multiple layers of caching (memory, same-machine memcached, same-zone memcached; for Braze's use case)

@ericmustin
Copy link
Contributor

@zachmccormick Hey there, thanks for flagging this. We have some upcoming sprint work scheduled around improving our Rails Instrumentation and I think it would make sense to try to include this work in there. We'll try to update here with any relevant PRs when they're made.

@zachmccormick
Copy link
Contributor Author

awesome - thank you!

@delner delner added bug Involves a bug community Was opened by a community member integrations Involves tracing integrations labels Apr 1, 2021
@rahul342
Copy link

@delner @ericmustin any updates on this? We have similar issue where we used multiple stores, but everything gets tagged as our Rails.cache store. I checked this is the still the issue on latest 0.54.2

@marcotc
Copy link
Member

marcotc commented Sep 8, 2022

@zachmccormick & @rahul342, I took at this and got a bit of work done to fix it: #2262

The issue can be solve by simply reporting the correct backend type for the ActiveSupport cache instance being instrumented.

There were a few hurdles in order to keep it backwards compatible, but it seems tenable.

I'll circle back when the changes are shipped in a public release.

@marcotc marcotc assigned marcotc and unassigned ericmustin Sep 8, 2022
@marcotc
Copy link
Member

marcotc commented Jul 9, 2024

This was fixed in version 1.15.0: #3060

@marcotc marcotc closed this as completed Jul 9, 2024
@github-project-automation github-project-automation bot moved this to Resolved (without changes) in Planning Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
Status: Resolved (without changes)
Development

No branches or pull requests

5 participants