Module: Datadog::Tracing::Contrib::ActiveJob::Patcher
- Includes:
- Patcher
- Defined in:
- lib/datadog/tracing/contrib/active_job/patcher.rb
Overview
Patcher enables patching of 'active_job' module.
Class Method Summary collapse
- .inject_data_streams ⇒ Object
- .inject_log_correlation ⇒ Object
- .patch ⇒ Object
- .target_version ⇒ Object
Methods included from Patcher
Class Method Details
.inject_data_streams ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/datadog/tracing/contrib/active_job/patcher.rb', line 39 def inject_data_streams # ActiveJob 4.2 deserializes jobs through a class method rather than the # instance method, so the DSM pathway can only be propagated on 5.0+. return if ::ActiveJob.gem_version < Gem::Version.new("5.0.0") ::ActiveSupport.on_load(:active_job) do prepend DataStreams end end |
.inject_log_correlation ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/datadog/tracing/contrib/active_job/patcher.rb', line 29 def inject_log_correlation ::ActiveSupport.on_load(:active_job) do if ::ActiveJob.gem_version < Gem::Version.new("6.0.0") include LogInjection::AroundPerformPatch else include LogInjection::PerformNowPatch end end end |
.patch ⇒ Object
23 24 25 26 27 |
# File 'lib/datadog/tracing/contrib/active_job/patcher.rb', line 23 def patch Events.subscribe! inject_log_correlation inject_data_streams end |
.target_version ⇒ Object
19 20 21 |
# File 'lib/datadog/tracing/contrib/active_job/patcher.rb', line 19 def target_version Integration.version end |