Sha256: c3148717ed57e00c91e3bda0d43b71f9d776e259f677a8f55e62e3db16a7b31c
Contents?: true
Size: 1.03 KB
Versions: 7
Compression:
Stored size: 1.03 KB
Contents
require 'ddtrace/ext/manual_tracing' require 'ddtrace/ext/priority' module Datadog # Defines analytics behavior module ForcedTracing class << self def keep(span) return if span.nil? || span.context.nil? span.context.sampling_priority = Datadog::Ext::Priority::USER_KEEP end def drop(span) return if span.nil? || span.context.nil? span.context.sampling_priority = Datadog::Ext::Priority::USER_REJECT end end # Extension for Datadog::Span module Span def set_tag(key, value) # Configure sampling priority if they give us a forced tracing tag # DEV: Do not set if the value they give us is explicitly "false" case key when Ext::ManualTracing::TAG_KEEP ForcedTracing.keep(self) unless value == false when Ext::ManualTracing::TAG_DROP ForcedTracing.drop(self) unless value == false else # Otherwise, set the tag normally. super if defined?(super) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems