Class: NewRelic::Agent::DistributedTracing::Monitor

Inherits:
InboundRequestMonitor show all
Defined in:
lib/new_relic/agent/monitors/distributed_tracing_monitor.rb

Instance Attribute Summary

Attributes inherited from InboundRequestMonitor

#obfuscator

Instance Method Summary collapse

Methods inherited from InboundRequestMonitor

#deserialize_header, #initialize, #setup_obfuscator

Constructor Details

This class inherits a constructor from NewRelic::Agent::InboundRequestMonitor

Instance Method Details

#on_before_call(request) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/new_relic/agent/monitors/distributed_tracing_monitor.rb', line 15

def on_before_call(request)
  unless NewRelic::Agent.config[:'distributed_tracing.enabled']
    NewRelic::Agent.logger.warn('Not configured to accept distributed trace headers')
    return
  end

  return unless txn = Tracer.current_transaction

  txn.distributed_tracer.accept_incoming_request(request)
end

#on_finished_configuring(events) ⇒ Object



9
10
11
12
13
# File 'lib/new_relic/agent/monitors/distributed_tracing_monitor.rb', line 9

def on_finished_configuring(events)
  return unless NewRelic::Agent.config[:'distributed_tracing.enabled']

  events.subscribe(:before_call, &method(:on_before_call))
end