Class OtlpGrpcMetricExporter
java.lang.Object
io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter
- All Implemented Interfaces:
io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector,io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector,io.opentelemetry.sdk.metrics.export.MetricExporter,Closeable,AutoCloseable
@ThreadSafe
public final class OtlpGrpcMetricExporter
extends Object
implements io.opentelemetry.sdk.metrics.export.MetricExporter
Exports metrics using OTLP via gRPC, using OpenTelemetry's protobuf model.
- Since:
- 1.14.0
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new builder instance for this exporter.io.opentelemetry.sdk.common.CompletableResultCodeexport(Collection<io.opentelemetry.sdk.metrics.data.MetricData> metrics) Submits all the given metrics in a single batch to the OpenTelemetry collector.io.opentelemetry.sdk.common.CompletableResultCodeflush()The OTLP exporter does not batch metrics, so this method will immediately return with success.io.opentelemetry.sdk.metrics.data.AggregationTemporalitygetAggregationTemporality(io.opentelemetry.sdk.metrics.InstrumentType instrumentType) static OtlpGrpcMetricExporterReturns a newOtlpGrpcMetricExporterreading the configuration values from the environment and from system properties.io.opentelemetry.sdk.metrics.AggregationgetDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType instrumentType) io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector
withMethods inherited from interface io.opentelemetry.sdk.metrics.export.MetricExporter
close
-
Method Details
-
getDefault
Returns a newOtlpGrpcMetricExporterreading 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
OtlpGrpcMetricExporterinstance.
-
builder
Returns a new builder instance for this exporter.- Returns:
- a new builder instance for this exporter.
-
getAggregationTemporality
public io.opentelemetry.sdk.metrics.data.AggregationTemporality getAggregationTemporality(io.opentelemetry.sdk.metrics.InstrumentType instrumentType) - Specified by:
getAggregationTemporalityin interfaceio.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector
-
getDefaultAggregation
public io.opentelemetry.sdk.metrics.Aggregation getDefaultAggregation(io.opentelemetry.sdk.metrics.InstrumentType instrumentType) - Specified by:
getDefaultAggregationin interfaceio.opentelemetry.sdk.metrics.export.DefaultAggregationSelector- Specified by:
getDefaultAggregationin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter
-
export
public io.opentelemetry.sdk.common.CompletableResultCode export(Collection<io.opentelemetry.sdk.metrics.data.MetricData> metrics) Submits all the given metrics in a single batch to the OpenTelemetry collector.- Specified by:
exportin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter- Parameters:
metrics- the list of Metrics to be exported.- Returns:
- the result of the operation
-
flush
public io.opentelemetry.sdk.common.CompletableResultCode flush()The OTLP exporter does not batch metrics, so this method will immediately return with success.- Specified by:
flushin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter- Returns:
- always Success
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled. The channel is forcefully closed after a timeout.- Specified by:
shutdownin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter
-