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 LongCounterAccess viaexported().private final Stringprivate final Attributesprivate final Supplier<MeterProvider> private LongCounterAccess viaseen().private final Attributesprivate final Attributesprivate final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateExporterMetrics(Supplier<MeterProvider> meterProviderSupplier, String exporterName, String type, String transportName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailed(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(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc".static ExporterMetricscreateGrpcOkHttp(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-grpc-okhttp".static ExporterMetricscreateHttpJson(String exporterName, String type, Supplier<MeterProvider> meterProvider) Create an instance for recording exporter metrics under the meter"io.opentelemetry.exporters." + exporterName + "-http-json".static ExporterMetricscreateHttpProtobuf(String exporterName, String type, 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 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".
-