Sha256: d8ab51b06d776e0d60fbca0580ee0e5f26d9693a87bf9b4e53f45eaf38a03481
Contents?: true
Size: 1.16 KB
Versions: 25
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module Datadog module Tracing module Contrib module SemanticLogger # Instrumentation for SemanticLogger module Instrumentation def self.included(base) base.prepend(InstanceMethods) end # Instance methods for configuration module InstanceMethods def log(log, message = nil, progname = nil, &block) return super unless Datadog.configuration.tracing.log_injection return super unless Datadog.configuration.tracing[:semantic_logger].enabled return super unless log.is_a?(::SemanticLogger::Log) original_named_tags = log.named_tags || {} # Retrieves trace information for current thread correlation = Tracing.correlation # if the user already has conflicting log_tags # we want them to clobber ours, because we should allow them to override if needed. log.named_tags = correlation.to_h.merge(original_named_tags) super(log, message, progname, &block) end end end end end end end
Version data entries
25 entries across 25 versions & 2 rubygems