Class: Datadog::Core::Telemetry::Event::Base
- Inherits:
-
Object
- Object
- Datadog::Core::Telemetry::Event::Base
- Defined in:
- lib/datadog/core/telemetry/event.rb
Overview
Base class for all Telemetry V2 events.
Direct Known Subclasses
AppClientConfigurationChange, AppClosing, AppDependenciesLoaded, AppHeartbeat, AppIntegrationsChange, AppStarted, GenerateMetrics, Log
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Override equality to allow for deduplication The basic implementation is to check if the other object is an instance of the same class.
- #hash ⇒ Object
-
#payload ⇒ Object
The JSON payload for the event.
-
#type ⇒ Object
The type of the event.
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 |
#hash ⇒ Object
45 46 47 |
# File 'lib/datadog/core/telemetry/event.rb', line 45 def hash self.class.hash end |
#payload ⇒ Object
The JSON payload for the event.
29 30 31 |
# File 'lib/datadog/core/telemetry/event.rb', line 29 def payload {} end |
#type ⇒ Object
The type of the event. It must be one of the stings defined in the Telemetry V2 specification for event names.
24 25 26 |
# File 'lib/datadog/core/telemetry/event.rb', line 24 def type raise NotImplementedError, 'Must be implemented by subclass' end |