Repository navigation
Conversation
Applications exporting custom OpenTelemetry telemetry can disable default Cloud Monitoring client metrics with disable_builtin_metrics=True.
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces Cloud Spanner Observability samples in Python, featuring a sample script to disable built-in Cloud Monitoring metrics, along with its associated configuration, dependency files, and tests. Feedback is provided to simplify a redundant nested os.environ.get call in the test configuration file.
| LIVE_DATABASE_ID = os.environ.get( | ||
| "SPANNER_DATABASE_ID", os.environ.get("SPANNER_DATABASE_ID", "") | ||
| ) |
There was a problem hiding this comment.
Thanks! This comment refers to an earlier revision of this file; the code here has since been reworked in later commits, so this thread no longer applies to the current diff.
Avoids logging project identifiers in stdout or stderr diagnostics and simplifies duplicate environment lookup in test configuration.
…omission Simplifies duplicate SPANNER_DATABASE_ID lookup in test configuration and asserts project identifiers are omitted from output.
…tions Prints only runtime query results and verifies real spanner.Client options via wraps in live integration tests.
Problem: review of this sample identified correctness and robustness improvements in the sample and its tests. Solution: apply the accepted review suggestions and extend the tests to cover the updated behavior. Details are in the review thread replies. Files updated: - spanner/observability/README.md - spanner/observability/tests/disable_builtin_metrics_test.py
Description
Applications managing their own OpenTelemetry pipelines can opt out of built-in Cloud Monitoring client-side metrics by passing
disable_builtin_metrics=Truetospanner.Client.Establishes
spanner/observabilityand addsspanner_disable_builtin_metricsto replace the inline snippet.Checklist
Testing
Compliance & Style
spanner/, which the default repository owners cover.Post-Approval Actions