Interface MetricExporter
- All Superinterfaces:
AggregationTemporalitySelector
,AutoCloseable
,Closeable
,DefaultAggregationSelector
public interface MetricExporter
extends AggregationTemporalitySelector, DefaultAggregationSelector, Closeable
A Metric Exporter is a push based interface for exporting
MetricData
out of SdkMeterProvider
.
To use, associate an exporter with a PeriodicMetricReader
, and register with the
metrics SDK via SdkMeterProviderBuilder.registerMetricReader(MetricReader)
.
- Since:
- 1.14.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
Closes thisMetricExporter
, releasing any resources.io.opentelemetry.sdk.common.CompletableResultCode
export
(Collection<MetricData> metrics) Exports themetrics
.io.opentelemetry.sdk.common.CompletableResultCode
flush()
A hint that any metrics previouslyexport(Collection)
ed should be completed.default Aggregation
getDefaultAggregation
(InstrumentType instrumentType) Return the default aggregation for theInstrumentType
.io.opentelemetry.sdk.common.CompletableResultCode
shutdown()
Shuts down the exporter.Methods inherited from interface io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector
getAggregationTemporality
Methods inherited from interface io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector
with
-
Method Details
-
getDefaultAggregation
Return the default aggregation for theInstrumentType
.- Specified by:
getDefaultAggregation
in interfaceDefaultAggregationSelector
- Since:
- 1.16.0
- See Also:
-
export
Exports themetrics
. The caller (i.e.PeriodicMetricReader
will not call export until the previous call completes.- Parameters:
metrics
- the metrics to export.- Returns:
- the result of the export, which is often an asynchronous operation.
-
flush
io.opentelemetry.sdk.common.CompletableResultCode flush()A hint that any metrics previouslyexport(Collection)
ed should be completed.- Returns:
- the result of the flush, which is often an asynchronous operation.
-
shutdown
io.opentelemetry.sdk.common.CompletableResultCode shutdown()Shuts down the exporter.Called when
PeriodicMetricReader.shutdown()
of the associated reader is called.- Returns:
- a
CompletableResultCode
which is completed when shutdown completes.
-
close
default void close()Closes thisMetricExporter
, releasing any resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-