Class: OpenTelemetry::SDK::Metrics::Export::ConsoleMetricPullExporter

Inherits:
MetricReader
  • Object
show all
Defined in:
lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb

Overview

Outputs MetricData to the console

Potentially useful for exploratory purposes.

Instance Attribute Summary

Attributes inherited from MetricReader

#metric_store

Instance Method Summary collapse

Methods inherited from MetricReader

#collect

Constructor Details

#initializeConsoleMetricPullExporter

Returns a new instance of ConsoleMetricPullExporter.



15
16
17
18
# File 'lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb', line 15

def initialize
  super
  @stopped = false
end

Instance Method Details

#export(metrics, timeout: nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb', line 24

def export(metrics, timeout: nil)
  return FAILURE if @stopped

  Array(metrics).each { |metric| pp metric }

  SUCCESS
end

#force_flush(timeout: nil) ⇒ Object



32
33
34
# File 'lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb', line 32

def force_flush(timeout: nil)
  SUCCESS
end

#pullObject



20
21
22
# File 'lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb', line 20

def pull
  export(collect)
end

#shutdown(timeout: nil) ⇒ Object



36
37
38
39
# File 'lib/opentelemetry/sdk/metrics/export/console_metric_pull_exporter.rb', line 36

def shutdown(timeout: nil)
  @stopped = true
  SUCCESS
end