Closed
Description
openedon Mar 21, 2024
Current behaviour
If redis-activesupport
is present, then only ActiveSupport::Cache::RedisStore
is patched (for methods that it has), and ActiveSupport::Cache::Store
is not patched.
dd-trace-rb/lib/datadog/tracing/contrib/active_support/cache/redis.rb
Lines 25 to 38 in 210ed96
Expected behaviour
ActiveSupport::Cache::Store
is always patched, because it may be used with cache backends other than redis.
Steps to reproduce
- Create an application with with
redis-activesupport
present - Create a cache using a non-redis backend (eg
ActiveSupport::Cache::MemCacheStore
) - Note that cache writes are not instrumented (because we didn't patch the
:write
method ofActiveSupport::Cache::Store
)
One solution could be to patch multiple classes - ie if redis is present and defines the method, patch both classes, rather than one or the other.
Environment
- ddtrace version: 1.12
- Configuration block (
Datadog.configure ...
): - Ruby version: 3.0.6
- Operating system: Linux
- Relevant library versions:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment