feat(bigquery): Integrate Otel into retries, jobs, and more by whuffman36 · Pull Request #3842 · googleapis/java-bigquery · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

feat(bigquery): Integrate Otel into retries, jobs, and more #3842

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

Merged
merged 7 commits into from
Jun 23, 2025
Merged

Conversation

whuffman36
Copy link
Contributor

The more here refers to TableDataWriteChannel. This PR also changes the signature of BigQueryRetryHelper.runWithRetries() to include a boolean and Otel Tracer as parameters.

@whuffman36 whuffman36 self-assigned this Jun 10, 2025
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/java-bigquery API. labels Jun 10, 2025
@whuffman36 whuffman36 marked this pull request as ready for review June 11, 2025 19:10
@whuffman36 whuffman36 requested review from a team as code owners June 11, 2025 19:10
@@ -476,7 +476,9 @@ private BigQueryResult queryRpc(
bigQueryOptions.getRetrySettings(),
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
bigQueryOptions.getClock(),
retryConfig);
retryConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're not supporting open telemetry in the Connection interface. I think it might be better to pass in (false, null) instead of (bigQueryOptions.isOpenTelemetryTracingEnabled(), and bigQueryOptions.getOpenTelemetryTracer()), respectively, since the later would create spans in the child calls without the encapsulating parent span in ConnectionImpl.

We probably should also explicitly call out that open telemetry is not supported in the Connection Interface in the further sample + README.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, making a note to explicitly state that otel is not supported in the connection interface for when I do the sample. Are you thinking of stating that in the root README or the samples/README file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think stating it in:

  1. Root README
  2. As a comment in the open telemetry sample.
    Would be sufficient.

runWithRetries =
openTelemetryTracer
.spanBuilder("com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries")
.setAttribute("bq.retry.retry_settings", retrySettings.toString())
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little iffy on this attribute, but I could be convinced. It seems like retrySettings comes from gax rather than this library, and may communicate settings outsite the scope of our particular usages.

With this work users will see the runWithRetries as a single parent span containing the child attempts? That should provide insight into when retries occurred and their individual durations (modulo all the things we do inside runWithRetries being instruments).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, the structure itself should be sufficient - I removed the attribute. How do you feel about the retrySettings attributes in waitForJob?

@@ -476,7 +476,9 @@ private BigQueryResult queryRpc(
bigQueryOptions.getRetrySettings(),
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
bigQueryOptions.getClock(),
retryConfig);
retryConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think stating it in:

  1. Root README
  2. As a comment in the open telemetry sample.
    Would be sufficient.

@whuffman36 whuffman36 merged commit 4b28c47 into main Jun 23, 2025
18 of 22 checks passed
@whuffman36 whuffman36 deleted the otel-cont branch June 23, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.