feat(spanner): add EnableDirectAccess field to ClientConfig#14287
feat(spanner): add EnableDirectAccess field to ClientConfig#14287sakthivelmanii merged 3 commits intomainfrom
Conversation
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.
There was a problem hiding this comment.
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.
| // EnableDirectAccess option is used to enable the directpath. | ||
| // | ||
| // Default: false |
There was a problem hiding this comment.
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: falsePR 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>
This change introduces the
EnableDirectAccessboolean toClientConfig, allowing users to explicitly configure whether the Spanner client connects to the directpath XDS endpoint.The environment variable
GOOGLE_SPANNER_ENABLE_DIRECT_ACCESScontinues to remain fully supported, and takes precedence over the programmatic client configuration for flexible overriding.