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
53 54 55 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 53 def self.compatible? super && (redis_compatible? || redis_client_compatible?) end |
.loaded? ⇒ Boolean
41 42 43 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 41 def self.loaded? redis_loaded? || redis_client_loaded? end |
.redis_client_compatible? ⇒ Boolean
61 62 63 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 61 def self.redis_client_compatible? !!(redis_client_version && redis_client_version >= REDISCLIENT_MINIMUM_VERSION) end |
.redis_client_loaded? ⇒ Boolean
49 50 51 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 49 def self.redis_client_loaded? !defined?(::RedisClient).nil? end |
.redis_client_version ⇒ Object
37 38 39 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 37 def self.redis_client_version Gem.loaded_specs['redis-client'] && Gem.loaded_specs['redis-client'].version end |
.redis_compatible? ⇒ Boolean
57 58 59 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 57 def self.redis_compatible? !!(redis_version && redis_version >= MINIMUM_VERSION) end |
.redis_loaded? ⇒ Boolean
45 46 47 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 45 def self.redis_loaded? !defined?(::Redis).nil? end |
.redis_version ⇒ Object
33 34 35 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 33 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.
29 30 31 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 29 def self.version redis_version || redis_client_version end |
Instance Method Details
#new_configuration ⇒ Object
65 66 67 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 65 def new_configuration Configuration::Settings.new end |
#patcher ⇒ Object
69 70 71 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 69 def patcher Patcher end |
#resolver ⇒ Object
73 74 75 |
# File 'lib/datadog/tracing/contrib/redis/integration.rb', line 73 def resolver @resolver ||= Configuration::Resolver.new end |