public class CompositeDatastoreMetricsRecorder implements DatastoreMetricsRecorderA DatastoreMetricsRecorder implementation that fans out recording calls to multiple underlying recorders.
This allows simultaneous recording to both built-in (Cloud Monitoring) and custom (user-provided) OpenTelemetry backends.
Implements
DatastoreMetricsRecorderConstructors
CompositeDatastoreMetricsRecorder(List<DatastoreMetricsRecorder> recorders)
public CompositeDatastoreMetricsRecorder(List<DatastoreMetricsRecorder> recorders)| Parameter | |
|---|---|
| Name | Description |
recorders |
List<DatastoreMetricsRecorder> |
Methods
close()
public void close()Closes all underlying recorders.
Each recorder's own DatastoreMetricsRecorder#close() semantics apply: recorders that own their io.opentelemetry.api.OpenTelemetry instance (built-in path) will flush and shut down; recorders backed by a user-provided instance will no-op. All recorders are closed even if one throws an exception.
recordAttemptCount(long count, Map<String,String> attributes)
public void recordAttemptCount(long count, Map<String,String> attributes)| Parameters | |
|---|---|
| Name | Description |
count |
long |
attributes |
Map<String,String> |
recordAttemptLatency(double latencyMs, Map<String,String> attributes)
public void recordAttemptLatency(double latencyMs, Map<String,String> attributes)| Parameters | |
|---|---|
| Name | Description |
latencyMs |
double |
attributes |
Map<String,String> |
recordOperationCount(long count, Map<String,String> attributes)
public void recordOperationCount(long count, Map<String,String> attributes)| Parameters | |
|---|---|
| Name | Description |
count |
long |
attributes |
Map<String,String> |
recordOperationLatency(double latencyMs, Map<String,String> attributes)
public void recordOperationLatency(double latencyMs, Map<String,String> attributes)| Parameters | |
|---|---|
| Name | Description |
latencyMs |
double |
attributes |
Map<String,String> |
recordTransactionAttemptCount(long count, Map<String,String> attributes)
public void recordTransactionAttemptCount(long count, Map<String,String> attributes)Records the number of attempts a transaction took.
| Parameters | |
|---|---|
| Name | Description |
count |
long |
attributes |
Map<String,String> |
recordTransactionLatency(double latencyMs, Map<String,String> attributes)
public void recordTransactionLatency(double latencyMs, Map<String,String> attributes)Records the total latency of a transaction in milliseconds.
| Parameters | |
|---|---|
| Name | Description |
latencyMs |
double |
attributes |
Map<String,String> |