| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| "enable_end_to_end_tracing", enable_end_to_end_tracing | ||
| ) | ||
| db_name = observability_options.get("db_name", db_name) | ||
| cloud_region = observability_options.get("cloud_region", cloud_region) |
There was a problem hiding this comment.
What is the use of this ?
IMU, observability_options is something which customers can set and does not have cloud_region property.
Sorry, something went wrong.
There was a problem hiding this comment.
this line is not required as _get_cloud_region is overriding the value in next line. Removed
Sorry, something went wrong.
| if "request_options" in attributes: | ||
| request_options = attributes.pop("request_options") | ||
| if request_options and request_options.request_tag: | ||
| attributes["spanner.request_tag"] = request_options.request_tag |
There was a problem hiding this comment.
Please use attribute name as request.tag and transaction.tag to be consistent with other languages.
Sorry, something went wrong.
There was a problem hiding this comment.
Do we also need the same for transaction.tag
Sorry, something went wrong.
There was a problem hiding this comment.
Refactored to request.tag. transaction tag is already transaction.tag so it shouldn't need any change right?
Sorry, something went wrong.
| # Overwrite the requests timeout for the detector. | ||
| # This is necessary as the client will wait the full timeout if the | ||
| # code is not run in a GCP environment, with the location endpoints available. | ||
| gcp_resource_detector._TIMEOUT_SEC = 0.2 |
There was a problem hiding this comment.
Please check if we need this timeout in the new code after refactoring. Currently get region does not have any timeout
Sorry, something went wrong.
There was a problem hiding this comment.
Yes got missed while moving the logic to helper. Added back
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
This change enhances observability by introducing these new features:
Cloud Region Attribute: The cloud.region attribute is now added to all OpenTelemetry spans generated by the Spanner client. This provides better geographical context for traces, aiding in performance analysis and debugging across different regions.
Transaction Tag: The transaction_tag set on a Transaction object is now correctly propagated and included in the Commit request. This allows for better end-to-end traceability of transactions.
Request Tag: This introduces support for request_tag on individual Spanner operations like read, execute_sql, and execute_update. When a request_tag is provided in the request_options, it is now added as a spanner.request_tag attribute to the corresponding OpenTelemetry span. This allows for more granular tracing and debugging of specific requests within a transaction or a snapshot.