Interface MetricReader
- All Known Implementing Classes:
PeriodicMetricReader
public interface MetricReader
A reader of metrics from
SdkMeterProvider.
Custom implementations of MetricReader are not currently supported. Please use one of
the built-in readers such as PeriodicMetricReader.
-
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.sdk.common.CompletableResultCodeflush()Flushes metrics read by this reader.getAggregationTemporality(InstrumentType instrumentType) Return the default aggregation temporality for theInstrumentType.voidregister(CollectionRegistration registration) Called bySdkMeterProviderand supplies theMetricReaderwith a handle to collect metrics.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Shuts down the metric reader.
-
Method Details
-
register
Called bySdkMeterProviderand supplies theMetricReaderwith a handle to collect metrics.CollectionRegistrationis currently an empty interface because custom implementations ofMetricReaderare not currently supported. -
getAggregationTemporality
Return the default aggregation temporality for theInstrumentType. -
flush
io.opentelemetry.sdk.common.CompletableResultCode flush()Flushes metrics read by this reader.In all scenarios, the trigger a metrics collection.
For readers associated with push
MetricExporters, this shouldMetricExporter.export(Collection)the collected metrics.- Returns:
- the result of the flush.
-
shutdown
io.opentelemetry.sdk.common.CompletableResultCode shutdown()Shuts down the metric reader.For pull endpoints, like prometheus, this should shut down the metric hosting endpoint or server doing such a job.
For push endpoints, this should shut down any scheduler threads.
- Returns:
- the result of the shutdown.
-