Class: Datadog::Contrib::GRPC::Patcher::DeprecatedPin

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

Overview

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

Constant Summary collapse

DEPRECATION_WARNING =
%(
Use of Datadog::Pin with GRPC 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, #writer

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



59
60
61
62
63
# File 'lib/ddtrace/contrib/grpc/patcher.rb', line 59

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

#service_name=(service_name) ⇒ Object



55
56
57
# File 'lib/ddtrace/contrib/grpc/patcher.rb', line 55

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