Class: Contrast::Agent::Reporting::AgentStartup

Inherits:
ServerReportingEvent show all
Defined in:
lib/contrast/agent/reporting/reporting_events/agent_startup.rb

Overview

AgentStartup Event which sends the agent data to TeamServer on the startup of a server or process, used to create a new Server entity there.

Instance Attribute Summary

Attributes inherited from ReportingEvent

#event_endpoint, #event_method

Instance Method Summary collapse

Methods inherited from ReportingEvent

#attach_headers

Methods inherited from ReportableHash

#event_json, #valid?, #validate

Methods included from Components::Logger::InstanceMethods

#cef_logger, #logger

Constructor Details

#initializeAgentStartup

Returns a new instance of AgentStartup.



13
14
15
16
17
18
# File 'lib/contrast/agent/reporting/reporting_events/agent_startup.rb', line 13

def initialize
  @event_method = :PUT
  @event_endpoint = Contrast::Agent::Reporting::Endpoints::NG_ENDPOINTS[:agent_startup]
  @event_type = :agent_startup
  super()
end

Instance Method Details

#file_nameObject



20
21
22
# File 'lib/contrast/agent/reporting/reporting_events/agent_startup.rb', line 20

def file_name
  'agent-startup'
end

#to_controlled_hashObject



24
25
26
27
28
29
30
# File 'lib/contrast/agent/reporting/reporting_events/agent_startup.rb', line 24

def to_controlled_hash
  {
      environment: ::Contrast::CONFIG.server.environment,
      tags: ::Contrast::CONFIG.server.tags,
      version: Contrast::Agent::VERSION
  }
end