Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add client id to metrics to avoid collisions (#117)
338e136 commit 338e136 Author: Knut Olav Løite <koloite@gmail.com> Date: Fri Mar 20 04:32:04 2020 +0100 fix: add client id to metrics to avoid collisions (#117) This PR adds an automatically generated identifier to all database clients that are created by the client library. This avoids collisions of the same metrics being registered multiple times, and makes it possible to distinguish different clients from each other in the monitoring. This PR does not allow the user to specify the id, but this could be added in a future change. That would need an API change by adding an overload to the method `getDatabaseClient(DatabaseId)` with an additional `clientId` parameter. This should also fix the build error in GoogleCloudPlatform/java-docs-samples#2323. Fixes #106 google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java google-cloud-spanner/src/main/java/com/google/cloud/spanner/MetricRegistryConstants.java google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestWithClosedSessionsEnv.java google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerImplTest.java
- Loading branch information
1 parent
58534bc
commit 774402c
Showing
7 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters