Skip to content

feat(bigquery): add url.template to span tracing#12181

Merged
ldetmer merged 5 commits intomainfrom
url-template
Mar 24, 2026
Merged

feat(bigquery): add url.template to span tracing#12181
ldetmer merged 5 commits intomainfrom
url-template

Conversation

@ldetmer
Copy link
Contributor

@ldetmer ldetmer commented Mar 24, 2026

This PR adds url.template to span tracing. It is added at client invocation as its not available in HttpRequest received by HttpTracingRequestInitializer.

Note this PR also adds this and previous PR attribute behind dev gate flag

example trace

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the observability of BigQuery operations by integrating the url.template into the OpenTelemetry tracing spans. This enhancement allows developers to see the specific API endpoint template associated with each BigQuery RPC call, which is crucial for debugging and understanding the flow of requests within a distributed system. The change ensures that this valuable context is available where it's most relevant, at the point of client invocation.

Highlights

  • Tracing Enhancement: Added the url.template attribute to OpenTelemetry spans for BigQuery RPC calls, providing more granular detail in distributed traces.
  • Implementation Strategy: The url.template is now captured at the client invocation level, as it is not available in the HttpRequest within the HttpTracingRequestInitializer.
  • Code Refactoring: Modified HttpBigQueryRpc to pass the uriTemplate to the span creation method and updated BigQueryTelemetryTracer to define the new attribute key, while removing it from HttpTracingRequestInitializer.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances OpenTelemetry tracing for BigQuery RPC calls by including the URI template in the generated spans. The changes involve modifying HttpBigQueryRpc.java to pass the URI template to the createRpcTracingSpan method across various BigQuery operations (Dataset, Table, Routine, Job, TableData, Model, IAM policies). A new URL_TEMPLATE attribute key is defined in BigQueryTelemetryTracer.java, and HttpBigQueryRpcTest.java is updated to verify this attribute. The URL_TEMPLATE attribute key is removed from HttpTracingRequestInitializer.java, consolidating its definition. The review feedback suggests using the BigQueryTelemetryTracer.URL_TEMPLATE constant in the test file for improved maintainability and consistency.

ldetmer and others added 3 commits March 24, 2026 11:43
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ldetmer ldetmer marked this pull request as ready for review March 24, 2026 15:50
@ldetmer ldetmer requested review from a team as code owners March 24, 2026 15:50
@ldetmer ldetmer requested review from jinseopkim0 and lqiu96 March 24, 2026 15:50
@ldetmer ldetmer marked this pull request as draft March 24, 2026 15:58
@ldetmer ldetmer marked this pull request as ready for review March 24, 2026 16:27
@ldetmer ldetmer merged commit 30f8afb into main Mar 24, 2026
70 of 72 checks passed
@ldetmer ldetmer deleted the url-template branch March 24, 2026 20:12
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.

2 participants