Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spanner: Native Metrics Enabled by Default in v1.71.0+ Causes Permission Errors #11673

Open
hodge1997 opened this issue Feb 28, 2025 · 0 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.

Comments

@hodge1997
Copy link

Description
After upgrading to Spanner client library versions >v1.71.0, our application began failing with permission errors (monitoring.timeSeries.create denied) in production. This is caused by the new native metrics collection being enabled by default, which requires the monitoring.metricWriter role. While disabling via DisableNativeMetrics: true resolves the issue, we believe this behavior introduces an unexpected breaking change and poses risks for existing users.

// Current behavior (v1.71.0+) causes errors unless explicitly disabled
client, err := spanner.NewClientWithConfig(ctx, database, spanner.ClientConfig{
    DisableNativeMetrics: true, // Required to avoid permission issues
})

Proposed Fixes
Change Default to DisableNativeMetrics: true:
Revert to disabling metrics by default to avoid breaking existing deployments.

Environment
Library Version: v1.71.0+

GCP Environment: Cloud Run / GKE / etc.

Permissions: Service account lacks monitoring.metricWriter.

@codyoss codyoss changed the title Breaking Change: Native Metrics Enabled by Default in v1.71.0+ Causes Permission Errors spanner: Native Metrics Enabled by Default in v1.71.0+ Causes Permission Errors Mar 3, 2025
@codyoss codyoss added the api: spanner Issues related to the Spanner API. label Mar 3, 2025
@codyoss codyoss added the triage me I really want to be triaged. label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants