Class GoogleCloudMetricExporter
- java.lang.Object
-
- com.google.cloud.opentelemetry.metric.GoogleCloudMetricExporter
-
- All Implemented Interfaces:
io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector,io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector,io.opentelemetry.sdk.metrics.export.MetricExporter,java.io.Closeable,java.lang.AutoCloseable
public class GoogleCloudMetricExporter extends java.lang.Object implements io.opentelemetry.sdk.metrics.export.MetricExporter
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static io.opentelemetry.sdk.metrics.export.MetricExportercreateWithConfiguration(MetricConfiguration configuration)Method that generates an instance ofGoogleCloudMetricExporterusing aMetricConfigurationthat allows the user to provide custom configuration for Traces.static io.opentelemetry.sdk.metrics.export.MetricExportercreateWithDefaultConfiguration()Method that generates an instance ofGoogleCloudMetricExporterusing a minimally configuredMetricConfigurationobject that requires no input from the user.io.opentelemetry.sdk.common.CompletableResultCodeexport(java.util.Collection<io.opentelemetry.sdk.metrics.data.MetricData> metrics)io.opentelemetry.sdk.common.CompletableResultCodeflush()io.opentelemetry.sdk.metrics.data.AggregationTemporalitygetAggregationTemporality(io.opentelemetry.sdk.metrics.InstrumentType instrumentType)io.opentelemetry.sdk.common.CompletableResultCodeshutdown()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
createWithDefaultConfiguration
public static io.opentelemetry.sdk.metrics.export.MetricExporter createWithDefaultConfiguration()
Method that generates an instance ofGoogleCloudMetricExporterusing a minimally configuredMetricConfigurationobject that requires no input from the user. Since no project ID is specified, default project ID is used instead. SeeServiceOptions.getDefaultProjectId()for details.This method defers the initialization of an actual
GoogleCloudMetricExporterto a point when it is actually needed - which is when the metrics need to be exported. As a result, while this method does not throw any exception, an exception may still be thrown during the attempt to generate the actualGoogleCloudMetricExporter.- Returns:
- A configured instance of
GoogleCloudMetricExporteras aMetricExporterwhich gets initialized lazily onceexport(Collection)is called.
-
createWithConfiguration
public static io.opentelemetry.sdk.metrics.export.MetricExporter createWithConfiguration(MetricConfiguration configuration)
Method that generates an instance ofGoogleCloudMetricExporterusing aMetricConfigurationthat allows the user to provide custom configuration for Traces.This method defers the initialization of an actual
GoogleCloudMetricExporterto a point when it is actually needed - which is when the metrics need to be exported. As a result, while this method does not throw any exception, an exception may still be thrown during the attempt to generate the actualGoogleCloudMetricExporter.- Parameters:
configuration- TheMetricConfigurationobject that determines the user preferences for metrics.- Returns:
- An instance of
GoogleCloudMetricExporteras aMetricExporterobject.
-
export
public io.opentelemetry.sdk.common.CompletableResultCode export(@Nonnull java.util.Collection<io.opentelemetry.sdk.metrics.data.MetricData> metrics)- Specified by:
exportin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter
-
flush
public io.opentelemetry.sdk.common.CompletableResultCode flush()
- Specified by:
flushin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
- Specified by:
shutdownin interfaceio.opentelemetry.sdk.metrics.export.MetricExporter
-
getAggregationTemporality
public io.opentelemetry.sdk.metrics.data.AggregationTemporality getAggregationTemporality(@Nonnull io.opentelemetry.sdk.metrics.InstrumentType instrumentType)- Specified by:
getAggregationTemporalityin interfaceio.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector
-
-