Sha256: e82db54c95b755ba6c09747996193d798669d3755b831b431ef22f59b32e87aa

Contents?: true

Size: 575 Bytes

Versions: 5

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

module Datadog
  module Tracing
    module Contrib
      module ActiveJob
        # Active Job log injection wrapped around job execution
        module LogInjection
          def self.included(base)
            base.class_eval do
              around_perform do |_, block|
                if logger.respond_to?(:tagged)
                  logger.tagged(Tracing.log_correlation, &block)
                else
                  block.call
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-1.12.1 lib/datadog/tracing/contrib/active_job/log_injection.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/active_job/log_injection.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/active_job/log_injection.rb
ddtrace-1.11.0 lib/datadog/tracing/contrib/active_job/log_injection.rb
ddtrace-1.11.0.beta1 lib/datadog/tracing/contrib/active_job/log_injection.rb