Class IntervalMetricReader
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.export.IntervalMetricReader
-
public final class IntervalMetricReader extends java.lang.ObjectWraps 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.Configuration options for
IntervalMetricReadercan be read from system properties, environment variables, orPropertiesobjects.For system properties and
Propertiesobjects,IntervalMetricReaderwill look for the following names:otel.imr.export.interval: sets the export interval between pushes to the exporter.
For environment variables,
IntervalMetricReaderwill look for the following names:OTEL_IMR_EXPORT_INTERVAL: sets the export interval between pushes to the exporter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntervalMetricReader.BuilderBuilder forIntervalMetricReader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntervalMetricReader.Builderbuilder()Returns a newIntervalMetricReader.BuilderforIntervalMetricReader.static IntervalMetricReader.BuilderbuilderFromDefaultSources()Returns a newIntervalMetricReader.BuilderforIntervalMetricReaderreading the configuration values from the environment and from system properties.voidshutdown()Stops the scheduled task and calls export one more time.
-
-
-
Method Detail
-
shutdown
public void shutdown()
Stops the scheduled task and calls export one more time.
-
builder
public static IntervalMetricReader.Builder builder()
Returns a newIntervalMetricReader.BuilderforIntervalMetricReader.- Returns:
- a new
IntervalMetricReader.BuilderforIntervalMetricReader.
-
builderFromDefaultSources
public static IntervalMetricReader.Builder builderFromDefaultSources()
Returns a newIntervalMetricReader.BuilderforIntervalMetricReaderreading the configuration values from the environment and from system properties. System properties override values defined in the environment. If a configuration value is missing, it uses the default value.- Returns:
- a new
IntervalMetricReader.BuilderforIntervalMetricReader.
-
-