-
Notifications
You must be signed in to change notification settings - Fork 99
fix: Provide Spanner Option to disable metrics #1460
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
Conversation
Summary of ChangesHello @surbhigarg92, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces enhanced control over the built-in metrics collection for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 introduces a new option disable_builtin_metrics to the Spanner Client constructor, allowing users to programmatically disable the built-in metrics collection. The implementation correctly considers both this new option and the existing environment variable SPANNER_DISABLE_BUILTIN_METRICS. The changes are well-tested, though there is a minor issue in a test docstring. Overall, this is a good addition for providing more control over metrics.
| """ | ||
| Test that Client constructor disable metrics using Spanner Option. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring seems to be a copy-paste from the test below. It should describe that this test validates disabling metrics via the environment variable, not the Spanner option.
| """ | |
| Test that Client constructor disable metrics using Spanner Option. | |
| """ | |
| """ | |
| Test that Client constructor disables metrics using an environment variable. | |
| """ |
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v1.0.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:8e2c32496077054105bd06c54a59d6a6694287bc053588e24debe6da6920ad91 <details><summary>google-cloud-spanner: 3.60.0</summary> ## [3.60.0](https://togithub.com/googleapis/python-spanner/compare/v3.59.0...v3.60.0) (2025-12-10) ### Features * make built-in metrics enabled by default (#1459) ([64aebe7](https://togithub.com/googleapis/python-spanner/commit/64aebe7e)) * Exposing AutoscalingConfig in InstancePartition ([8b6f154](https://togithub.com/googleapis/python-spanner/commit/8b6f1540)) * add support for experimental host (#1452) ([9535e5e](https://togithub.com/googleapis/python-spanner/commit/9535e5e0)) * enable OpenTelemetry metrics and tracing by default (#1410) ([bb5095d](https://togithub.com/googleapis/python-spanner/commit/bb5095df)) * add cloud.region, request_tag and transaction_tag in span attributes (#1449) ([d37fb80](https://togithub.com/googleapis/python-spanner/commit/d37fb80a)) * Add QueryAdvisorResult for query plan (PiperOrigin-RevId: 832425466) ([e08260f](https://togithub.com/googleapis/python-spanner/commit/e08260fe)) * Add Send and Ack mutations for Queues (PiperOrigin-RevId: 832425466) ([e08260f](https://togithub.com/googleapis/python-spanner/commit/e08260fe)) * Add Spanner location API (#1457) (PiperOrigin-RevId: 833474957) ([e08260f](https://togithub.com/googleapis/python-spanner/commit/e08260fe)) ### Bug Fixes * Deprecate credentials_file argument ([8b6f154](https://togithub.com/googleapis/python-spanner/commit/8b6f1540)) * configure keepAlive time for gRPC TCP connections (#1448) ([efb2833](https://togithub.com/googleapis/python-spanner/commit/efb2833e)) * Provide Spanner Option to disable metrics (#1460) ([f1ebc43](https://togithub.com/googleapis/python-spanner/commit/f1ebc43b)) ### Documentation * Update description for the BatchCreateSessionsRequest and Session (PiperOrigin-RevId: 832425466) ([e08260f](https://togithub.com/googleapis/python-spanner/commit/e08260fe)) * Update description for the IsolationLevel (PiperOrigin-RevId: 832425466) ([e08260f](https://togithub.com/googleapis/python-spanner/commit/e08260fe)) </details>
BEGIN_COMMIT_OVERRIDE
fix: Provide option to disable metrics via SpannerOption.
Release-As: 3.60.0
END_COMMIT_OVERRIDE