Method: OneApm::Collector::Commands::XraySessionCollection#handle_active_xray_sessions

Defined in:
lib/one_apm/collector/commands/xray_session_collection.rb

#handle_active_xray_sessions(agent_command) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/one_apm/collector/commands/xray_session_collection.rb', line 28

def handle_active_xray_sessions(agent_command)
  # If X-Rays are disabled, just be quiet about it and don't start the
  # command. Other hosts might be running the X-Ray, so we don't need
  # to bark on every get_agent_commands.
  if !OneApm::Manager.config[:'xray_session.enabled']
    OneApm::Manager.logger.debug("Not responding to X-Ray command because of config 'xray_session.enabled' = #{OneApm::Manager.config[:'xray_session.enabled']}")
    return
  end

  incoming_ids = agent_command.arguments["xray_ids"]
  deactivate_for_incoming_sessions(incoming_ids)
  activate_sessions(incoming_ids)
end