Class: Contrast::Agent::Telemetry::Event

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/contrast/agent/telemetry/event.rb

Overview

This class will hold the basic information for a Telemetry Event

Direct Known Subclasses

MetricEvent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.



15
16
17
18
# File 'lib/contrast/agent/telemetry/event.rb', line 15

def initialize
  @tags = MetricsHash.new(String)
  @timestamp = Time.now.iso8601
end

Instance Attribute Details

#tagsObject (readonly)

Returns the value of attribute tags.



13
14
15
# File 'lib/contrast/agent/telemetry/event.rb', line 13

def tags
  @tags
end

Instance Method Details

#pathObject



20
21
22
# File 'lib/contrast/agent/telemetry/event.rb', line 20

def path
  ''
end

#to_controlled_hash(**_args) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/contrast/agent/telemetry/event.rb', line 24

def to_controlled_hash **_args
  {
      tags: @tags,
      timestamp: @timestamp,
      instance: Contrast::Agent::Telemetry::Base.instance_id,
      application: Contrast::Agent::Telemetry::Base.application_id
  }
end