Class: OpenTelemetry::SDK::Metrics::Instrument::ObservableCounter
- Inherits:
-
AsynchronousInstrument
- Object
- AsynchronousInstrument
- OpenTelemetry::SDK::Metrics::Instrument::ObservableCounter
- Defined in:
- lib/opentelemetry/sdk/metrics/instrument/observable_counter.rb
Overview
ObservableCounter is the SDK implementation of AsynchronousInstrument. Asynchronous Counter is an asynchronous Instrument which reports monotonically increasing value(s) when the instrument is being observed.
Constant Summary
Constants inherited from AsynchronousInstrument
AsynchronousInstrument::NOOP_EXEMPLAR_RESERVOIR
Instance Method Summary collapse
-
#instrument_kind ⇒ Symbol
Returns the instrument kind as a Symbol.
-
#observe(timeout: nil, attributes: {}) ⇒ Object
Observe the ObservableCounter with fixed timeout duration.
Methods inherited from AsynchronousInstrument
#add_attributes, #init_callback, #initialize, #register_callback, #register_with_new_metric_store, #timeout, #unregister
Constructor Details
This class inherits a constructor from OpenTelemetry::SDK::Metrics::Instrument::AsynchronousInstrument
Instance Method Details
#instrument_kind ⇒ Symbol
Returns the instrument kind as a Symbol
17 18 19 |
# File 'lib/opentelemetry/sdk/metrics/instrument/observable_counter.rb', line 17 def instrument_kind :observable_counter end |
#observe(timeout: nil, attributes: {}) ⇒ Object
Observe the ObservableCounter with fixed timeout duration.
28 29 30 |
# File 'lib/opentelemetry/sdk/metrics/instrument/observable_counter.rb', line 28 def observe(timeout: nil, attributes: {}) update(timeout, attributes) end |