Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions lib/datadog/tracing/contrib/active_job/log_injection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ 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 Datadog.configuration.tracing.log_injection && logger.respond_to?(:tagged)
logger.tagged(Tracing.log_correlation, &block)
else
block.call
end
end
def perform_now
if Datadog.configuration.tracing.log_injection && logger.respond_to?(:tagged)
logger.tagged(Tracing.log_correlation) { super }
else
super
end
end
end
Expand Down