Module: OpenTelemetry::Instrumentation::ActiveJob::Patches::Base
- Defined in:
- lib/opentelemetry/instrumentation/active_job/patches/base.rb
Overview
Module to prepend to ActiveJob::Core for context propagation.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.prepended(base) ⇒ Object
13 14 15 16 17 |
# File 'lib/opentelemetry/instrumentation/active_job/patches/base.rb', line 13 def self.prepended(base) base.class_eval do attr_accessor :metadata end end |
Instance Method Details
#deserialize(job_data) ⇒ Object
29 30 31 32 |
# File 'lib/opentelemetry/instrumentation/active_job/patches/base.rb', line 29 def deserialize(job_data) self. = deserialize_arguments(job_data['metadata'] || []).to_h super end |
#initialize(*args) ⇒ Object
19 20 21 22 |
# File 'lib/opentelemetry/instrumentation/active_job/patches/base.rb', line 19 def initialize(*args) @metadata = {} super end |
#serialize ⇒ Object
25 26 27 |
# File 'lib/opentelemetry/instrumentation/active_job/patches/base.rb', line 25 def serialize super.merge('metadata' => serialize_arguments()) end |