Class: OpenTelemetry::SDK::Metrics::Instrument::UpDownCounter
- Inherits:
-
SynchronousInstrument
- Object
- SynchronousInstrument
- OpenTelemetry::SDK::Metrics::Instrument::UpDownCounter
- Defined in:
- lib/opentelemetry/sdk/metrics/instrument/up_down_counter.rb
Overview
UpDownCounter is the SDK implementation of Metrics::UpDownCounter.
Instance Method Summary collapse
-
#add(amount, attributes: {}) ⇒ Object
Increment or decrement the UpDownCounter by a fixed amount.
-
#instrument_kind ⇒ Symbol
Returns the instrument kind as a Symbol.
Methods inherited from SynchronousInstrument
#initialize, #register_with_new_metric_store
Constructor Details
This class inherits a constructor from OpenTelemetry::SDK::Metrics::Instrument::SynchronousInstrument
Instance Method Details
#add(amount, attributes: {}) ⇒ Object
Increment or decrement the UpDownCounter by a fixed amount.
27 28 29 30 31 32 33 |
# File 'lib/opentelemetry/sdk/metrics/instrument/up_down_counter.rb', line 27 def add(amount, attributes: {}) update(amount, attributes) nil rescue StandardError => e OpenTelemetry.handle_error(exception: e) nil end |
#instrument_kind ⇒ Symbol
Returns the instrument kind as a Symbol
16 17 18 |
# File 'lib/opentelemetry/sdk/metrics/instrument/up_down_counter.rb', line 16 def instrument_kind :up_down_counter end |