module OpenTelemetry::Instrumentation::ActiveJob::Patches::Base

Module to prepend to ActiveJob::Core for context propagation.

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/active_job/patches/base.rb, line 19
def initialize(*args)
  @metadata = {}
  super
end
prepended(base) click to toggle source
# File lib/opentelemetry/instrumentation/active_job/patches/base.rb, line 13
def self.prepended(base)
  base.class_eval do
    attr_accessor :metadata
  end
end

Public Instance Methods

deserialize(job_data) click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/active_job/patches/base.rb, line 29
def deserialize(job_data)
  self.metadata = (deserialize_arguments(job_data['metadata']) || []).to_h
  super
end
serialize() click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/active_job/patches/base.rb, line 25
def serialize
  super.merge('metadata' => serialize_arguments(metadata))
end