Interface MetricReader
- All Known Implementing Classes:
PeriodicMetricReader
public interface MetricReader
A registered reader of metrics.
This interface provides the SdkMeterProvider
a mechanism
of global control over metrics during shutdown or memory pressure scenarios.
-
Method Details
-
getPreferredTemporality
Return The preferred temporality for metrics. -
flush
io.opentelemetry.sdk.common.CompletableResultCode flush()Flushes metrics read by this reader.In all scenarios, the associated
MetricProducer
should have itsMetricProducer.collectAllMetrics()
method called.For push endpoints, this should collect and report metrics as normal.
- Returns:
- the result of the shutdown.
-
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.
-