Class: Datadog::Tracing::Contrib::Redis::Integration
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::Redis::Integration
- Includes:
- Integration
- Defined in:
- lib/datadog/tracing/contrib/redis/integration.rb
Overview
Description of Redis integration
Constant Summary collapse
- MINIMUM_VERSION =
Gem::Version.new('3.2')
- REDISCLIENT_MINIMUM_VERSION =
Support ‘Config#custom` github.com/redis-rb/redis-client/blob/master/CHANGELOG.md#0110
Gem::Version.new('0.11.0')
Class Method Summary collapse
- .compatible? ⇒ Boolean
- .loaded? ⇒ Boolean
- .redis_client_compatible? ⇒ Boolean
- .redis_client_loaded? ⇒ Boolean
- .redis_client_version ⇒ Object
- .redis_compatible? ⇒ Boolean
- .redis_loaded? ⇒ Boolean
- .redis_version ⇒ Object
-
.version ⇒ Object
Until Redis 4, all instrumentation happened in one gem: redis.
Instance Method Summary collapse
Methods included from Integration
Class Method Details
.compatible? ⇒ Boolean
51 52 53 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 51 def self.compatible? super && (redis_compatible? || redis_client_compatible?) end |
.loaded? ⇒ Boolean
39 40 41 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 39 def self.loaded? redis_loaded? || redis_client_loaded? end |
.redis_client_compatible? ⇒ Boolean
59 60 61 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 59 def self.redis_client_compatible? !!(redis_client_version && redis_client_version >= REDISCLIENT_MINIMUM_VERSION) end |
.redis_client_loaded? ⇒ Boolean
47 48 49 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 47 def self.redis_client_loaded? !defined?(::RedisClient).nil? end |
.redis_client_version ⇒ Object
35 36 37 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 35 def self.redis_client_version Gem.loaded_specs['redis-client'] && Gem.loaded_specs['redis-client'].version end |
.redis_compatible? ⇒ Boolean
55 56 57 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 55 def self.redis_compatible? !!(redis_version && redis_version >= MINIMUM_VERSION) end |
.redis_loaded? ⇒ Boolean
43 44 45 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 43 def self.redis_loaded? !defined?(::Redis).nil? end |
.redis_version ⇒ Object
31 32 33 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 31 def self.redis_version Gem.loaded_specs['redis'] && Gem.loaded_specs['redis'].version end |
.version ⇒ Object
Until Redis 4, all instrumentation happened in one gem: redis. Since Redis 5, instrumentation happens in a separate gem: redis-client. Because Redis 4 does not depend on redis-client, it’s possible for both gems to be installed at the same time. For example, if Sidekiq 7 and Redis 4 are installed: both redis and redis-client will be installed. If redis-client and redis > 5 are installed, than they will be in sync, and only redis-client will be installed.
27 28 29 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 27 def self.version redis_version || redis_client_version end |
Instance Method Details
#new_configuration ⇒ Object
63 64 65 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 63 def new_configuration Configuration::Settings.new end |
#patcher ⇒ Object
67 68 69 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 67 def patcher Patcher end |
#resolver ⇒ Object
71 72 73 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 71 def resolver @resolver ||= Configuration::Resolver.new end |