Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement propagation of x-goog-spanner-request-id gRPC header on every call #3537

Open
6 tasks
odeke-em opened this issue Dec 9, 2024 · 0 comments
Open
6 tasks
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API.

Comments

@odeke-em
Copy link
Contributor

odeke-em commented Dec 9, 2024

This is a feature request to implement propagation of x-goog-spanner-request-id gRPC header on every call.

Reasoning

x-goog-spanner-request-id allows propagation of an ID that'll be correlated between client and server calls. We can't rely on trace headers because they are sampled, convoluted through a bunch of infrastructure so Google Engineering asked that we craft up a better mechanism. The value will allow tracking the operations of an RPC even through retries

Requirements

Each x-goog-spanner-request-id requires the following fields

  • Version of the specification being implemented: ordinal number: 1 for version 1
  • random Uint64 for the process' lifetime
  • ID of the SpannerClient being used
  • channelID for the gRPC channel being used
  • Nth Request Count: nthReq
  • RPC attempt number for nthReq

Specification

Please reference https://orijtech.notion.site/x-goog-spanner-request-id-always-on-gRPC-header-to-aid-in-quick-debugging-of-errors-14aba6bc91348091a58fca7a505c9827?pvs=4

Reference implementation

I built a Go reference implementation at googleapis/google-cloud-go#11048

/cc @tharoldD

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Dec 9, 2024
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 12, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 12, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 14, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 14, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537

Address code review comments
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 15, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537

Address code review comments
odeke-em added a commit to orijtech/java-spanner that referenced this issue Feb 17, 2025
This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates googleapis#3537

Address code review comments
olavloite pushed a commit that referenced this issue Feb 18, 2025
* chore(x-goog-spanner-request-id): commit foundation

This change adds in the bases to bring in the functionality
for the "x-goog-spanner-request-id" that'll be used for debugging
without the limits of trace continuity and sampling.

Updates #3537

Address code review comments

* RandProcessId MUST be 64-bits and not 32-bits

* Use BigInteger to generate the 64-bit integer

* Make RAND_PROCESS_ID static final too
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 googleapis/java-spanner API.
Projects
None yet
Development

No branches or pull requests

2 participants