module Datadog::OpenTelemetry::Span

Extensions for Datadog::Span

Constants

TAG_SERVICE_NAME
TAG_SERVICE_VERSION

Public Instance Methods

set_tag(key, value) click to toggle source
Calls superclass method
# File lib/ddtrace/opentelemetry/span.rb, line 10
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 TAG_SERVICE_NAME
    if defined?(super)
      # Set original tag and Datadog version tag
      self.service = value
      super
    end
  when TAG_SERVICE_VERSION
    if defined?(super)
      # Set original tag and Datadog version tag
      super
      super(Datadog::Ext::Environment::TAG_VERSION, value)
    end
  else
    # Otherwise, set the tag normally.
    super if defined?(super)
  end
end