Class OtlpGrpcMetricExporter
java.lang.Object
io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter
- All Implemented Interfaces:
AggregationTemporalitySelector, DefaultAggregationSelector, MetricExporter, Closeable, AutoCloseable
Exports metrics using OTLP via gRPC, using OpenTelemetry's protobuf model.
- Since:
- 1.14.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AggregationTemporalitySelectorprivate final GrpcExporterBuilder<Marshaler> private final DefaultAggregationSelectorprivate final GrpcExporter<Marshaler> private final MetricReusableDataMarshaler -
Constructor Summary
ConstructorsConstructorDescriptionOtlpGrpcMetricExporter(GrpcExporterBuilder<Marshaler> builder, GrpcExporter<Marshaler> delegate, AggregationTemporalitySelector aggregationTemporalitySelector, DefaultAggregationSelector defaultAggregationSelector, MemoryMode memoryMode) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new builder instance for this exporter.export(Collection<MetricData> metrics) Submits all the given metrics in a single batch to the OpenTelemetry collector.flush()The OTLP exporter does not batch metrics, so this method will immediately return with success.getAggregationTemporality(InstrumentType instrumentType) Return the aggregation temporality for theInstrumentType.static OtlpGrpcMetricExporterReturns a newOtlpGrpcMetricExporterusing the default values.getDefaultAggregation(InstrumentType instrumentType) Return the default aggregation for theInstrumentType.Returns the memory mode used by this exporter's associated reader.shutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.Returns a builder with configuration values equal to those for this exporter.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface DefaultAggregationSelector
withMethods inherited from interface MetricExporter
close
-
Field Details
-
builder
-
delegate
-
aggregationTemporalitySelector
-
defaultAggregationSelector
-
marshaler
-
-
Constructor Details
-
OtlpGrpcMetricExporter
OtlpGrpcMetricExporter(GrpcExporterBuilder<Marshaler> builder, GrpcExporter<Marshaler> delegate, AggregationTemporalitySelector aggregationTemporalitySelector, DefaultAggregationSelector defaultAggregationSelector, MemoryMode memoryMode)
-
-
Method Details
-
getDefault
Returns a newOtlpGrpcMetricExporterusing the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpGrpcMetricExporterinstance.
-
builder
Returns a new builder instance for this exporter.- Returns:
- a new builder instance for this exporter.
-
toBuilder
Returns a builder with configuration values equal to those for this exporter.IMPORTANT: Be sure to
shutdown()this instance if it will no longer be used.- Since:
- 1.29.0
-
getAggregationTemporality
Description copied from interface:AggregationTemporalitySelectorReturn the aggregation temporality for theInstrumentType.- Specified by:
getAggregationTemporalityin interfaceAggregationTemporalitySelector
-
getDefaultAggregation
Description copied from interface:MetricExporterReturn the default aggregation for theInstrumentType.- Specified by:
getDefaultAggregationin interfaceDefaultAggregationSelector- Specified by:
getDefaultAggregationin interfaceMetricExporter- See Also:
-
getMemoryMode
Description copied from interface:MetricExporterReturns the memory mode used by this exporter's associated reader.- Specified by:
getMemoryModein interfaceMetricExporter- Returns:
- The
MemoryModeused by this exporter's associated reader
-
export
Submits all the given metrics in a single batch to the OpenTelemetry collector.- Specified by:
exportin interfaceMetricExporter- Parameters:
metrics- the list of Metrics to be exported.- Returns:
- the result of the operation
-
flush
The OTLP exporter does not batch metrics, so this method will immediately return with success.- Specified by:
flushin interfaceMetricExporter- Returns:
- always Success
-
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 interfaceMetricExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes.
-
toString
-