Constructor
new GCPMetricsHandler(exporter)
The GCPMetricsHandler
is responsible for managing and recording
client-side metrics for Google Cloud Bigtable using OpenTelemetry. It
handles the creation and configuration of various metric instruments
(histograms and counters) and exports them to Google Cloud Monitoring
through the provided PushMetricExporter
.
Parameters:
Name | Type | Description |
---|---|---|
exporter |
The |
Methods
getInstruments()
Initializes the OpenTelemetry metrics instruments if they haven't been already. Creates and registers metric instruments (histograms and counters) for various Bigtable client metrics. Sets up a MeterProvider and configures a PeriodicExportingMetricReader for exporting metrics to Cloud Monitoring.
which will be provided to the exporter in every export call.
onAttemptComplete(data)
Records metrics for a completed attempt of a Bigtable operation. This method records attempt latency, connectivity error count, server latency, along with the provided attributes.
Parameters:
Name | Type | Description |
---|---|---|
data |
OnAttemptCompleteData |
Data related to the completed attempt. |
onOperationComplete(data)
Records metrics for a completed Bigtable operation. This method records the operation latency and retry count, associating them with provided attributes.
Parameters:
Name | Type | Description |
---|---|---|
data |
OnOperationCompleteData |
Data related to the completed operation. |