Skip to content

Commit 7cb7538

Browse files
committed
fix: remove misleading metrics project mismatch log from getDatabaseClient
The log fired on every getDatabaseClient call even when metricsProjectId was not explicitly set, producing noise. DatabaseId is not available at build time so validation cannot move to SpannerOptions#build(). Since the log is misleading rather than helpful, remove it entirely.
1 parent 3657027 commit 7cb7538

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

  • java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner

java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,6 @@ public DatabaseClient getDatabaseClient(DatabaseId db) {
306306
if (dbClients.containsKey(db)) {
307307
return dbClients.get(db);
308308
} else {
309-
SpannerOptions opts = getOptions();
310-
String metricsProject = opts.resolveMetricsProjectId();
311-
if (opts.isEnableBuiltInMetrics()
312-
&& metricsProject != null
313-
&& !metricsProject.equals(db.getInstanceId().getProject())) {
314-
logger.log(
315-
Level.INFO,
316-
"Built-in metrics project ''{0}'' differs from DatabaseId project ''{1}''."
317-
+ " Use setMetricsProjectId() to override if needed.",
318-
new Object[] {metricsProject, db.getInstanceId().getProject()});
319-
}
320309
if (clientId == null) {
321310
clientId = nextDatabaseClientId(db);
322311
}

0 commit comments

Comments
 (0)