Gauge instrument that records non-additive values of type A.
Gauges are used to record values that are not additive, such as room temperature or CPU usage.
Type Signature
F[_]- the higher-kinded type of a polymorphic effectA- the type of values to record. Must have aMeasurementValueinstance.LongandDoubleare supported out of the box.
Creating a Gauge
Gauges are created using theMeter API:
Backend Methods
record
Records a value with a set of attributes.The value to record.
The set of attributes to associate with the value.
F[Unit]
Example:
Builder Methods
withUnit
Sets the unit of measure for this gauge.The measurement unit. Must be 63 or fewer ASCII characters.
Gauge.Builder[F, A]
Reference: Instrument Unit
withDescription
Sets the description for this gauge.The description of the gauge.
Gauge.Builder[F, A]
Reference: Instrument Description
create
Creates aGauge with the configured unit and description.
Returns: F[Gauge[F, A]]
See Also
- UpDownCounter - for recording additive values
- OpenTelemetry Gauge Specification