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 CallbackRegistration
callbackRegistration
private static java.util.logging.Logger
logger
private java.util.concurrent.atomic.AtomicBoolean
removed
private SdkMeter
sdkMeter
private ThrottlingLogger
throttlingLogger
-
Constructor Summary
Constructors Constructor Description SdkObservableInstrument(SdkMeter sdkMeter, CallbackRegistration callbackRegistration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Remove the callback registered viaDoubleCounterBuilder.buildWithCallback(Consumer)
.java.lang.String
toString()
-
-
-
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:ObservableDoubleCounter
Remove 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceBatchCallback
- Specified by:
close
in interfaceObservableDoubleCounter
- Specified by:
close
in interfaceObservableDoubleGauge
- Specified by:
close
in interfaceObservableDoubleUpDownCounter
- Specified by:
close
in interfaceObservableLongCounter
- Specified by:
close
in interfaceObservableLongGauge
- Specified by:
close
in interfaceObservableLongUpDownCounter
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-