Module: OpenTelemetry::Metrics::Handles

Defined in:
lib/opentelemetry/metrics/handles.rb

Overview

In situations where performance is a requirement and a metric is repeatedly used with the same labels, the developer may elect to use instrument Handles as an optimization. For handles to be a benefit, it requires that a specific instrument will be re-used with specific labels. If an instrument will be used with the same labels more than once, obtaining an instrument handle corresponding to the labels ensures the highest performance available.

To obtain a handle given an instrument and labels, use the #handle method to return an interface that supports the #add or #record method of the instrument in question.

Instrument handles may consume SDK resources indefinitely.

Defined Under Namespace

Classes: FloatCounter, FloatMeasure, IntegerCounter, IntegerMeasure