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

feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner server side tracing #3162

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

nareshz
Copy link

@nareshz nareshz commented Jun 18, 2024

This PR add changes required for enabling tracing on Spanner server side. The changes include:

  • Add x-goog-spanner-end-to-end-tracing header to Spanner RPC contexts.

    The header is added to support server side tracing feature, which aims to create trace spans at Spanner layer to provide more context to customers on their requests to Spanner.

    This feature is off by default and can be enabled by enabling server side tracing while creating Spanner object.

    Spanner spanner = SpannerOptions.newBuilder().enableServerSideTracing().build().getService();

  • For Server side tracing feature, traceparent header is required on the Spanner layer in all the requests. This change help in passing traceparent header inside Spanner requests if Context propagators are setup in OpenTelemetrySdk. These traceparent headers will be only added if client has opted-in for server side tracing by setting the enableServerSideTracing option in SpannerOptions.

@nareshz nareshz requested review from a team as code owners June 18, 2024 08:33
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Jun 18, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: xs Pull request size is extra small. labels Jul 10, 2024
@nareshz nareshz requested a review from olavloite July 18, 2024 03:37
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Aug 9, 2024
@nareshz nareshz changed the title feat: Add Grpc Telemetry client interceptor for trace context propagation feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner server side tracing Aug 9, 2024
Copy link
Collaborator

@olavloite olavloite left a comment

Choose a reason for hiding this comment

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

LGTM, with a couple of minor nits.

Oh, and please also fix the clirr build failure. For that, you need to add an exception to the clirr-ignored-differences.xml file.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 12, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 12, 2024
@rahul2393 rahul2393 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 12, 2024
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. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants