Class ExporterMetrics
- java.lang.Object
-
- io.opentelemetry.exporter.internal.ExporterMetrics
-
public class ExporterMetrics extends java.lang.Object
Helper for recording metrics from exporters.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description private static AttributeKey<java.lang.Boolean>
ATTRIBUTE_KEY_SUCCESS
private static AttributeKey<java.lang.String>
ATTRIBUTE_KEY_TYPE
private LongCounter
exported
Access viaexported()
.private java.lang.String
exporterName
private Attributes
failedAttrs
private java.util.function.Supplier<MeterProvider>
meterProviderSupplier
private LongCounter
seen
Access viaseen()
.private Attributes
seenAttrs
private Attributes
successAttrs
private java.lang.String
transportName
-
Constructor Summary
Constructors Modifier Constructor Description private
ExporterMetrics(java.util.function.Supplier<MeterProvider> meterProviderSupplier, java.lang.String exporterName, java.lang.String type, java.lang.String transportName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFailed(long value)
Record number of records which failed to export.void
addSeen(long value)
Record number of records seen.void
addSuccess(long value)
Record number of records which successfully exported.static ExporterMetrics
createGrpc(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc
".static ExporterMetrics
createGrpcOkHttp(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc-okhttp
".static ExporterMetrics
createHttpJson(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http-json
".static ExporterMetrics
createHttpProtobuf(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http
".private LongCounter
exported()
private Meter
meter()
private LongCounter
seen()
-
-
-
Field Detail
-
ATTRIBUTE_KEY_TYPE
private static final AttributeKey<java.lang.String> ATTRIBUTE_KEY_TYPE
-
ATTRIBUTE_KEY_SUCCESS
private static final AttributeKey<java.lang.Boolean> ATTRIBUTE_KEY_SUCCESS
-
meterProviderSupplier
private final java.util.function.Supplier<MeterProvider> meterProviderSupplier
-
exporterName
private final java.lang.String exporterName
-
transportName
private final java.lang.String transportName
-
seenAttrs
private final Attributes seenAttrs
-
successAttrs
private final Attributes successAttrs
-
failedAttrs
private final Attributes failedAttrs
-
seen
@Nullable private volatile LongCounter seen
Access viaseen()
.
-
exported
@Nullable private volatile LongCounter exported
Access viaexported()
.
-
-
Constructor Detail
-
ExporterMetrics
private ExporterMetrics(java.util.function.Supplier<MeterProvider> meterProviderSupplier, java.lang.String exporterName, java.lang.String type, java.lang.String transportName)
-
-
Method Detail
-
addSeen
public void addSeen(long value)
Record number of records seen.
-
addSuccess
public void addSuccess(long value)
Record number of records which successfully exported.
-
addFailed
public void addFailed(long value)
Record number of records which failed to export.
-
seen
private LongCounter seen()
-
exported
private LongCounter exported()
-
meter
private Meter meter()
-
createGrpc
public static ExporterMetrics createGrpc(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc
".
-
createGrpcOkHttp
public static ExporterMetrics createGrpcOkHttp(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc-okhttp
".
-
createHttpProtobuf
public static ExporterMetrics createHttpProtobuf(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http
".
-
createHttpJson
public static ExporterMetrics createHttpJson(java.lang.String exporterName, java.lang.String type, java.util.function.Supplier<MeterProvider> meterProvider)
Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http-json
".
-
-