-
Notifications
You must be signed in to change notification settings - Fork 664
Attach gRPC Metadata to Requests #7369
Copy link
Copy link
Open
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.library: spannerIssues transferred from another repositoryIssues transferred from another repositorypriority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.library: spannerIssues transferred from another repositoryIssues transferred from another repositorypriority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
Under certain circumstances, we need to route Spanner queries via a gRPC proxy, which expects clients to provide some extra contexts to make better decisions.
However, currently the Spanner Node.js client has very limited ability to inject context:
transactionTagrequestTagDescribe the solution you'd like
gRPC metadata is the standard way to provide extra context for requests. In Node.js it is done like:
It would be great if the Spanner client allows attaching gRPC Metadata to requests. For example:
Additional context
The Spanner Go client already supports this: