Class ExporterMetrics
java.lang.Object
io.opentelemetry.exporter.internal.ExporterMetrics
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
FieldsModifier and TypeFieldDescriptionprivate static final AttributeKey
<Boolean> private static final AttributeKey
<String> private LongCounter
Access viaexported()
.private final String
private final Attributes
private final Supplier
<MeterProvider> private LongCounter
Access viaseen()
.private final Attributes
private final Attributes
private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ExporterMetrics
(Supplier<MeterProvider> meterProviderSupplier, String exporterName, String type, String transportName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc
".static ExporterMetrics
createGrpcOkHttp
(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc-okhttp
".static ExporterMetrics
createHttpJson
(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http-json
".static ExporterMetrics
createHttpProtobuf
(String exporterName, String type, 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 Details
-
ATTRIBUTE_KEY_TYPE
-
ATTRIBUTE_KEY_SUCCESS
-
meterProviderSupplier
-
exporterName
-
transportName
-
seenAttrs
-
successAttrs
-
failedAttrs
-
seen
Access viaseen()
. -
exported
Access viaexported()
.
-
-
Constructor Details
-
ExporterMetrics
private ExporterMetrics(Supplier<MeterProvider> meterProviderSupplier, String exporterName, String type, String transportName)
-
-
Method Details
-
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
-
exported
-
meter
-
createGrpc
public static ExporterMetrics createGrpc(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc
". -
createGrpcOkHttp
public static ExporterMetrics createGrpcOkHttp(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc-okhttp
". -
createHttpProtobuf
public static ExporterMetrics createHttpProtobuf(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http
". -
createHttpJson
public static ExporterMetrics createHttpJson(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http-json
".
-