Class ExtendedDefaultMeter.NoopLongGaugeBuilder
java.lang.Object
io.opentelemetry.api.incubator.metrics.ExtendedDefaultMeter.NoopLongGaugeBuilder
- All Implemented Interfaces:
ExtendedLongGaugeBuilder
,LongGaugeBuilder
- Enclosing class:
ExtendedDefaultMeter
private static class ExtendedDefaultMeter.NoopLongGaugeBuilder
extends Object
implements ExtendedLongGaugeBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ExtendedDefaultMeter.NoopLongGauge
private static final ObservableLongGauge
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns a LongGauge instrument with the configuration.Build an observer for this instrument to observe values from aBatchCallback
.buildWithCallback
(Consumer<ObservableLongMeasurement> callback) Builds an Asynchronous Gauge instrument with the given callback.setDescription
(String description) Sets the description for this instrument.Sets the unit of measure for this instrument.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder
setAttributesAdvice
-
Field Details
-
NOOP_OBSERVABLE_GAUGE
-
NOOP_GAUGE
-
-
Constructor Details
-
NoopLongGaugeBuilder
private NoopLongGaugeBuilder()
-
-
Method Details
-
setDescription
Description copied from interface:LongGaugeBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceLongGaugeBuilder
- Parameters:
description
- The description.- See Also:
-
setUnit
Description copied from interface:LongGaugeBuilder
Sets the unit of measure for this instrument.- Specified by:
setUnit
in interfaceLongGaugeBuilder
- Parameters:
unit
- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
-
buildWithCallback
Description copied from interface:LongGaugeBuilder
Builds an Asynchronous Gauge instrument with the given callback.The callback will be called when the instrument is being observed.
Callbacks are expected to abide by the following restrictions:
- Run in a finite amount of time.
- Safe to call repeatedly, across multiple threads.
- Specified by:
buildWithCallback
in interfaceLongGaugeBuilder
- Parameters:
callback
- A callback which observes measurements when invoked.
-
buildObserver
Description copied from interface:LongGaugeBuilder
Build an observer for this instrument to observe values from aBatchCallback
.This observer MUST be registered when creating a
batchCallback
, which records to it. Values observed outside registered callbacks are ignored.- Specified by:
buildObserver
in interfaceLongGaugeBuilder
- Returns:
- an observable measurement that batch callbacks use to observe values.
-
build
Description copied from interface:LongGaugeBuilder
Builds and returns a LongGauge instrument with the configuration.NOTE: This produces a synchronous gauge which records gauge values as they occur. Most users will want to instead register an
LongGaugeBuilder.buildWithCallback(Consumer)
to asynchronously observe the value of the gauge when metrics are collected.If using the OpenTelemetry SDK, by default gauges use last value aggregation, such that only the value of the last recorded measurement is exported.
- Specified by:
build
in interfaceLongGaugeBuilder
- Returns:
- The LongGauge instrument.
-