googleapis / googleapis/google-cloud-java
[java-spanner-jdbc] feat: Add OpenTelemetry metrics to JDBC driver
- Dominant language
- Java
- Stars
- 2.1k
- Forks
- 1.2k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 154
Description
The Cloud Spanner JDBC driver uses the Java client library for communication with Cloud Spanner, and all metrics that are defined in the client library are also used by the JDBC driver. The JDBC driver also adds some additional features that are not covered by the metrics in the Java client library, and could be added to the JDBC driver:
* Transaction retries and aborted transactions: The JDBC driver implements an internal retry mechanism to reduce the number of Aborted errors for client applications. Metrics that measure the number of successful and failed retries could give clients valuable information on possible concurrency issues (or just temporary high load).
* Writing mutations: The JDBC driver allows clients to use Mutations to write data to Cloud Spanner. This is not present in the JDBC specification, and will not be covered by any standard instrumentation for JDBC.
* Transaction duration: JDBC uses declarative transactions and the duration of those are not measured by the client library. The JDBC driver could add a measurement for the duration of read/write transactions to allow clients to monitor for possibly long-during transactions.
Contributor guide
Assessment
This issue has not been assessed yet.