Class: OneApm::Agent::InboundRequestMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/one_apm/agent/inbound_request_monitor.rb

Direct Known Subclasses

CrossAppMonitor, SyntheticsMonitor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events) ⇒ InboundRequestMonitor

Returns a new instance of InboundRequestMonitor.



9
10
11
12
13
14
# File 'lib/one_apm/agent/inbound_request_monitor.rb', line 9

def initialize(events)
  events.subscribe(:finished_configuring) do
    setup_obfuscator
    on_finished_configuring(events)
  end
end

Instance Attribute Details

#obfuscatorObject (readonly)

Returns the value of attribute obfuscator.



7
8
9
# File 'lib/one_apm/agent/inbound_request_monitor.rb', line 7

def obfuscator
  @obfuscator
end

Instance Method Details

#deserialize_header(encoded_header, key) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/one_apm/agent/inbound_request_monitor.rb', line 20

def deserialize_header(encoded_header, key)
  decoded_header = obfuscator.deobfuscate(encoded_header)
  OneApm::JSONWrapper.load(decoded_header)
rescue => err
  OneApm::Manager.logger.debug("Failure deserializing encoded header '#{key}' in #{self.class}, #{err.class}, #{err.message}")
  nil
end

#setup_obfuscatorObject



16
17
18
# File 'lib/one_apm/agent/inbound_request_monitor.rb', line 16

def setup_obfuscator
  @obfuscator = OneApm::Agent::Obfuscator.new(OneApm::Manager.config[:encoding_key])
end