Package io.opentelemetry.sdk.metrics
Class SdkObservableInstrument
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.SdkObservableInstrument
-
- All Implemented Interfaces:
BatchCallback,ObservableDoubleCounter,ObservableDoubleGauge,ObservableDoubleUpDownCounter,ObservableLongCounter,ObservableLongGauge,ObservableLongUpDownCounter,java.lang.AutoCloseable
class SdkObservableInstrument extends java.lang.Object implements ObservableDoubleCounter, ObservableLongCounter, ObservableDoubleGauge, ObservableLongGauge, ObservableDoubleUpDownCounter, ObservableLongUpDownCounter, BatchCallback
-
-
Field Summary
Fields Modifier and Type Field Description private CallbackRegistrationcallbackRegistrationprivate static java.util.logging.Loggerloggerprivate java.util.concurrent.atomic.AtomicBooleanremovedprivate SdkMetersdkMeterprivate ThrottlingLoggerthrottlingLogger
-
Constructor Summary
Constructors Constructor Description SdkObservableInstrument(SdkMeter sdkMeter, CallbackRegistration callbackRegistration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Remove the callback registered viaDoubleCounterBuilder.buildWithCallback(Consumer).java.lang.StringtoString()
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
throttlingLogger
private final ThrottlingLogger throttlingLogger
-
sdkMeter
private final SdkMeter sdkMeter
-
callbackRegistration
private final CallbackRegistration callbackRegistration
-
removed
private final java.util.concurrent.atomic.AtomicBoolean removed
-
-
Constructor Detail
-
SdkObservableInstrument
SdkObservableInstrument(SdkMeter sdkMeter, CallbackRegistration callbackRegistration)
-
-
Method Detail
-
close
public void close()
Description copied from interface:ObservableDoubleCounterRemove the callback registered viaDoubleCounterBuilder.buildWithCallback(Consumer). After this is called, the callback won't be invoked on future collections. Subsequent calls toObservableDoubleCounter.close()have no effect.Note: other callbacks registered to the instrument with the same identity are unaffected.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceBatchCallback- Specified by:
closein interfaceObservableDoubleCounter- Specified by:
closein interfaceObservableDoubleGauge- Specified by:
closein interfaceObservableDoubleUpDownCounter- Specified by:
closein interfaceObservableLongCounter- Specified by:
closein interfaceObservableLongGauge- Specified by:
closein interfaceObservableLongUpDownCounter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-