Skip to content

feat(spanner): add EnableDirectAccess field to ClientConfig#14287

Merged
sakthivelmanii merged 3 commits intomainfrom
feat/spanner-enable-direct-access
Mar 30, 2026
Merged

feat(spanner): add EnableDirectAccess field to ClientConfig#14287
sakthivelmanii merged 3 commits intomainfrom
feat/spanner-enable-direct-access

Conversation

@sakthivelmanii
Copy link
Copy Markdown
Contributor

This change introduces the EnableDirectAccess boolean to ClientConfig, allowing users to explicitly configure whether the Spanner client connects to the directpath XDS endpoint.

The environment variable GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS continues to remain fully supported, and takes precedence over the programmatic client configuration for flexible overriding.

This change introduces the EnableDirectAccess boolean to ClientConfig, allowing users to explicitly configure whether the Spanner client connects to the directpath XDS endpoint.

The environment variable GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS continues to remain fully supported, and takes precedence over the programmatic client configuration for flexible overriding.
@sakthivelmanii sakthivelmanii requested review from a team as code owners March 29, 2026 16:28
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Mar 29, 2026
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 introduces an EnableDirectAccess field to the ClientConfig struct, providing a programmatic way to enable DirectPath in the Spanner client. The internal logic was updated to ensure that the GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS environment variable takes precedence over this new configuration field. Feedback was provided to improve the documentation of the new field by explicitly mentioning this precedence to avoid potential user confusion.

Comment thread spanner/client.go
Comment on lines +377 to +379
// EnableDirectAccess option is used to enable the directpath.
//
// Default: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve clarity for users, it would be helpful to mention in this comment that the GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS environment variable takes precedence over this programmatic setting. This will prevent confusion about which configuration is applied.

	// EnableDirectAccess option is used to enable the directpath.
	// This setting is overridden by the GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS
	// environment variable if it is set.
	//
	// Default: false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@sakthivelmanii sakthivelmanii merged commit 6adf5b7 into main Mar 30, 2026
10 checks passed
@sakthivelmanii sakthivelmanii deleted the feat/spanner-enable-direct-access branch March 30, 2026 06:27
rahul2393 added a commit that referenced this pull request Apr 14, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.10.1
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:b04b076f5eedbb5546bd6fc1404969dd3698c8b19c0f34ae815a84ae735a606a
<details><summary>spanner: v1.90.0</summary>

##
[v1.90.0](spanner/v1.89.0...spanner/v1.90.0)
(2026-04-14)

### Features

* feat(spanner): add EnableDirectAccess field to ClientConfig (#14287)
([6adf5b7](6adf5b7))
* feat(spanner): Switch to using builtin open telemetry for EEF
(#14193)([751febd](751febd))
* feat(spanner): complete location-aware routing resilience and
observability (#14418 )
([77aa4df](77aa4df))

###  Bug Fixes


* fix(spanner): set gauge metric start time to match end time (#14289)
([e0760b5](e0760b5))
* fix(spanner): update DirectPath detection logic to use ALTS
credentials(#14288)([3cd5716](3cd5716))

</details>
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants