Module: Datadog::Tracing::Contrib::MongoDB::Instrumentation::Client::InstanceMethods
- Defined in:
- lib/datadog/tracing/contrib/mongodb/instrumentation.rb
Overview
Instance methods for Mongo::Client
Instance Method Summary collapse
Instance Method Details
#datadog_pin ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/datadog/tracing/contrib/mongodb/instrumentation.rb', line 19 def datadog_pin # safe-navigation to avoid crashes during each query return unless respond_to? :cluster return unless cluster.respond_to? :addresses return unless cluster.addresses.respond_to? :first Datadog.configuration_for(cluster.addresses.first) end |
#datadog_pin=(pin) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/datadog/tracing/contrib/mongodb/instrumentation.rb', line 28 def datadog_pin=(pin) # safe-navigation to avoid crashes during each query return unless respond_to? :cluster return unless cluster.respond_to? :addresses return unless cluster.addresses.respond_to? :each # attach the PIN to all cluster addresses. One of them is used # when executing a Command and it is attached to the Monitoring # Event instance. cluster.addresses.each { |x| pin.onto(x) } end |