Class: OpenTelemetry::SDK::Metrics::Exemplar::ExemplarReservoir

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/sdk/metrics/exemplar/exemplar_reservoir.rb

Overview

ExemplarReservoir base class Subclasses must implement offer and collect methods

Instance Method Summary collapse

Instance Method Details

#collect(attributes: nil, aggregation_temporality: :delta) ⇒ Array

Return list of Exemplars based on given attributes

Parameters:

  • attributes (Hash) (defaults to: nil)

    Value of the measurement

  • aggregation_temporality (Symbol) (defaults to: :delta)

    Should remove the original exemplars or not, default delta

Returns:

  • (Array)

    exemplars Array of exemplars

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/opentelemetry/sdk/metrics/exemplar/exemplar_reservoir.rb', line 32

def collect(attributes: nil, aggregation_temporality: :delta)
  raise NotImplementedError, "#{self.class} must implement #collect"
end

#offer(value: nil, timestamp: nil, attributes: nil, context: nil) ⇒ Nil

Store the info into exemplars bucket

Parameters:

  • value (Numeric) (defaults to: nil)

    Value of the measurement

  • timestamp (Integer) (defaults to: nil)

    Time of recording in nanoseconds

  • attributes (Hash) (defaults to: nil)

    Complete set of Attributes of the measurement

  • context (Context) (defaults to: nil)

    SpanContext of the measurement, which covers the Baggage and the current active Span.

Returns:

  • (Nil)

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/opentelemetry/sdk/metrics/exemplar/exemplar_reservoir.rb', line 22

def offer(value: nil, timestamp: nil, attributes: nil, context: nil)
  raise NotImplementedError, "#{self.class} must implement #offer"
end