Class: Datadog::Core::Telemetry::Event::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/telemetry/event.rb

Overview

Base class for all Telemetry V2 events.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

Override equality to allow for deduplication The basic implementation is to check if the other object is an instance of the same class. This works for events that have no attributes. For events with attributes, you should override this method to compare the attributes.



37
38
39
# File 'lib/datadog/core/telemetry/event.rb', line 37

def ==(other)
  other.is_a?(self.class)
end

#hashObject

See Also:



45
46
47
# File 'lib/datadog/core/telemetry/event.rb', line 45

def hash
  self.class.hash
end

#payloadObject

The JSON payload for the event.



29
30
31
# File 'lib/datadog/core/telemetry/event.rb', line 29

def payload
  {}
end

#typeObject

The type of the event. It must be one of the stings defined in the Telemetry V2 specification for event names.

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/datadog/core/telemetry/event.rb', line 24

def type
  raise NotImplementedError, 'Must be implemented by subclass'
end