Class IntervalMetricReader
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.export.IntervalMetricReader
-
public final class IntervalMetricReader extends Object
Wraps a list ofMetricProducers and automatically reads and exports the metrics every export interval. Metrics may also be dropped when it becomes time to export again, and there is an export in progress.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntervalMetricReaderBuilderbuilder()Returns a newIntervalMetricReaderBuilderforIntervalMetricReader.io.opentelemetry.sdk.common.CompletableResultCodeforceFlush()Requests theIntervalMetricReaderto export current metrics and returns aCompletableResultCodewhich is completed when the flush is finished.static io.opentelemetry.sdk.common.CompletableResultCodeforceFlushGlobal()Force flushes the globally registeredIntervalMetricReaderif available, or does nothing otherwise.static voidresetGlobalForTest()Resets the globally registeredIntervalMetricReaderif available, or does nothing otherwise.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Stops the scheduled task and calls export one more time.IntervalMetricReaderstart()Starts thisIntervalMetricReaderto report to the configured exporter.IntervalMetricReaderstartAndRegisterGlobal()Starts thisIntervalMetricReaderand registers it as the globalIntervalMetricReader.
-
-
-
Method Detail
-
forceFlushGlobal
public static io.opentelemetry.sdk.common.CompletableResultCode forceFlushGlobal()
Force flushes the globally registeredIntervalMetricReaderif available, or does nothing otherwise.
-
resetGlobalForTest
public static void resetGlobalForTest()
Resets the globally registeredIntervalMetricReaderif available, or does nothing otherwise. This is only meant to be used from tests which need to reconfigureIntervalMetricReader.
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
Stops the scheduled task and calls export one more time.
-
builder
public static IntervalMetricReaderBuilder builder()
Returns a newIntervalMetricReaderBuilderforIntervalMetricReader.- Returns:
- a new
IntervalMetricReaderBuilderforIntervalMetricReader.
-
forceFlush
public io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
Requests theIntervalMetricReaderto export current metrics and returns aCompletableResultCodewhich is completed when the flush is finished.
-
start
public IntervalMetricReader start()
Starts thisIntervalMetricReaderto report to the configured exporter.
-
startAndRegisterGlobal
public IntervalMetricReader startAndRegisterGlobal()
Starts thisIntervalMetricReaderand registers it as the globalIntervalMetricReader.
-
-