Class ExporterMetrics
- java.lang.Object
-
- io.opentelemetry.exporter.internal.ExporterMetrics
-
public class ExporterMetrics extends java.lang.ObjectHelper 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_SUCCESSprivate static AttributeKey<java.lang.String>ATTRIBUTE_KEY_TYPEprivate LongCounterexportedAccess viaexported().private java.lang.StringexporterNameprivate AttributesfailedAttrsprivate java.util.function.Supplier<MeterProvider>meterProviderSupplierprivate LongCounterseenAccess viaseen().private AttributesseenAttrsprivate AttributessuccessAttrsprivate java.lang.StringtransportName
-
Constructor Summary
Constructors Modifier Constructor Description privateExporterMetrics(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 voidaddFailed(long value)Record number of records which failed to export.voidaddSeen(long value)Record number of records seen.voidaddSuccess(long value)Record number of records which successfully exported.static ExporterMetricscreateGrpc(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 ExporterMetricscreateGrpcOkHttp(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 ExporterMetricscreateHttpJson(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 ExporterMetricscreateHttpProtobuf(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 LongCounterexported()private Metermeter()private LongCounterseen()
-
-
-
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".
-
-