8000 chore: refactor all opentelemetry span logic for RPC calls into generic executeWithSpan function by ldetmer · Pull Request #12066 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

chore: refactor all opentelemetry span logic for RPC calls into generic executeWithSpan function#12066

Draft
ldetmer wants to merge 3 commits intomainfrom
refactor-existing-spans
Draft

chore: refactor all opentelemetry span logic for RPC calls into generic executeWithSpan function#12066
ldetmer wants to merge 3 commits intomainfrom
refactor-existing-spans

Conversation

@ldetmer
Copy link
Contributor
@ldetmer ldetmer commented Mar 12, 2026

This is to setup the ability to add new attributes to existing tracing span for the observability project. This is no-op functional change for the current code, but achieves the following:

  1. Moves all tracing logic (creation, attribute setting, closing) into new executeWithSpan generic function. Is useful for potential future changes.
  2. Adds the functionality to make each client span the current span. This does not have any affect on the traces themselves (see comparison below), but it does allow for us to retrieve this span in an HTTP interceptor and append additional attributes. See design: go/sdk:java-bigquery-observability. Without this change the current span returned is the parent span.

Example trace before change

Example trace after change

@ldetmer ldetmer changed the title chore: refactor all opentelemetry span for RPC calls in one place chore: refactor all opentelemetry span logic for RPC calls into generic executeWithSpan function Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0