Class: Datadog::Contrib::Faraday::Patcher::DeprecatedPin

Inherits:
Pin
  • Object
show all
Includes:
DeprecatedPin
Defined in:
lib/ddtrace/contrib/faraday/patcher.rb

Overview

Implementation of deprecated Pin, which raises warnings when accessed. To be removed when support for Datadog::Pin with Faraday is removed.

Constant Summary collapse

DEPRECATION_WARNING =
%(
Use of Datadog::Pin with Faraday is DEPRECATED.
Upgrade to the configuration API using the migration guide here:
https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0).freeze

Instance Attribute Summary

Attributes inherited from Pin

#app, #app_type, #config, #name, #service_name, #tags, #tracer

Instance Method Summary collapse

Methods included from DeprecatedPin

#onto

Methods included from Patcher

included

Methods included from Patcher::CommonMethods

#do_once, #done?, #without_warnings

Methods inherited from Pin

#enabled?, get_from, #initialize, #onto, #to_s

Constructor Details

This class inherits a constructor from Datadog::Pin

Instance Method Details

#log_deprecation_warning(method_name) ⇒ Object



73
74
75
76
77
# File 'lib/ddtrace/contrib/faraday/patcher.rb', line 73

def log_deprecation_warning(method_name)
  do_once(method_name) do
    Datadog::Tracer.log.warn("#{method_name}:#{DEPRECATION_WARNING}")
  end
end

#service_name=(service_name) ⇒ Object



69
70
71
# File 'lib/ddtrace/contrib/faraday/patcher.rb', line 69

def service_name=(service_name)
  Datadog.configuration[:faraday][:service_name] = service_name
end

#tracer=(tracer) ⇒ Object



65
66
67
# File 'lib/ddtrace/contrib/faraday/patcher.rb', line 65

def tracer=(tracer)
  Datadog.configuration[:faraday][:tracer] = tracer
end