Class: Datadog::Core::Telemetry::Event::GenerateMetrics

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

Overview

Telemetry class for the ‘generate-metrics’ event

Direct Known Subclasses

Distributions

Instance Method Summary collapse

Constructor Details

#initialize(namespace, metric_series) ⇒ GenerateMetrics

Returns a new instance of GenerateMetrics.



326
327
328
329
330
# File 'lib/datadog/core/telemetry/event.rb', line 326

def initialize(namespace, metric_series)
  super()
  @namespace = namespace
  @metric_series = metric_series
end

Instance Method Details

#payloadObject



332
333
334
335
336
337
# File 'lib/datadog/core/telemetry/event.rb', line 332

def payload
  {
    namespace: @namespace,
    series: @metric_series.map(&:to_h)
  }
end

#typeObject



322
323
324
# File 'lib/datadog/core/telemetry/event.rb', line 322

def type
  'generate-metrics'
end