Class IntervalMetricReader.Builder
- java.lang.Object
-
- io.opentelemetry.sdk.common.export.ConfigBuilder<IntervalMetricReader.Builder>
-
- io.opentelemetry.sdk.metrics.export.IntervalMetricReader.Builder
-
- Enclosing class:
- IntervalMetricReader
public static final class IntervalMetricReader.Builder extends io.opentelemetry.sdk.common.export.ConfigBuilder<IntervalMetricReader.Builder>
Builder forIntervalMetricReader.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntervalMetricReaderbuild()Builds a newIntervalMetricReaderwith current settings.protected IntervalMetricReader.BuilderfromConfigMap(java.util.Map<java.lang.String,java.lang.String> configMap, io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)Sets the configuration values from the given configuration map for only the available keys.IntervalMetricReader.BuildersetExportIntervalMillis(long exportIntervalMillis)Sets the export interval.IntervalMetricReader.BuildersetMetricExporter(MetricExporter metricExporter)Sets the exporter to be called when export metrics.IntervalMetricReader.BuildersetMetricProducers(java.util.Collection<MetricProducer> metricProducers)Sets a collection ofMetricProducerfrom where the metrics should be read.
-
-
-
Method Detail
-
setExportIntervalMillis
public IntervalMetricReader.Builder setExportIntervalMillis(long exportIntervalMillis)
Sets the export interval.- Parameters:
exportIntervalMillis- the export interval between pushes to the exporter.- Returns:
- this.
-
setMetricExporter
public IntervalMetricReader.Builder setMetricExporter(MetricExporter metricExporter)
Sets the exporter to be called when export metrics.- Parameters:
metricExporter- theMetricExporterto be called when export metrics.- Returns:
- this.
-
setMetricProducers
public IntervalMetricReader.Builder setMetricProducers(java.util.Collection<MetricProducer> metricProducers)
Sets a collection ofMetricProducerfrom where the metrics should be read.- Parameters:
metricProducers- a collection ofMetricProducerfrom where the metrics should be read.- Returns:
- this.
-
build
public IntervalMetricReader build()
Builds a newIntervalMetricReaderwith current settings.- Returns:
- a
IntervalMetricReader.
-
fromConfigMap
protected IntervalMetricReader.Builder fromConfigMap(java.util.Map<java.lang.String,java.lang.String> configMap, io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)
Sets the configuration values from the given configuration map for only the available keys.- Specified by:
fromConfigMapin classio.opentelemetry.sdk.common.export.ConfigBuilder<IntervalMetricReader.Builder>- Parameters:
configMap-Mapholding the configuration values.- Returns:
- this.
-
-