Skip to content

fix(spanner): honor built-in metrics opt-out for gRPC metrics exporter#12711

Merged
rahul2393 merged 2 commits intomainfrom
fix-12229
Apr 9, 2026
Merged

fix(spanner): honor built-in metrics opt-out for gRPC metrics exporter#12711
rahul2393 merged 2 commits intomainfrom
fix-12229

Conversation

@rahul2393
Copy link
Copy Markdown
Contributor

Fixes: #12229

setBuiltInMetricsEnabled(false) was only disabling the Spanner API tracer metrics path. During channel setup, the client could still install gRPC built-in metrics/export wiring and create the Cloud Monitoring exporter. In practice, users could
still see SpannerCloudMonitoringExporter attempts and monitoring.timeSeries.create permission failures even though startup logs reported:

  Built-in metrics enabled: false

That behavior contradicted the documented contract that setBuiltInMetricsEnabled(false) opts out of client-side metrics.

@rahul2393 rahul2393 requested review from a team as code owners April 8, 2026 15:05
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the enablegRPCMetrics method in SpannerOptions to check if built-in metrics are enabled before proceeding, and adds a unit test to verify that gRPC metrics are skipped when built-in metrics are disabled. The reviewer suggested renaming enablegRPCMetrics to enableGrpcMetrics to better align with Java camelCase naming conventions.

@rahul2393 rahul2393 merged commit 57baaea into main Apr 9, 2026
102 checks passed
@rahul2393 rahul2393 deleted the fix-12229 branch April 9, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java-spanner] .setBuiltInMetricsEnabled(false) simply has no effect

2 participants