Repository navigation
fix(bigquery-jdbc): build programmatic OpenTelemetry SDK with credential scoping and cache isolation - #15371
Open
keshavdandeva wants to merge 5 commits into
Open
fix(bigquery-jdbc): build programmatic OpenTelemetry SDK with credential scoping and cache isolation#15371keshavdandeva wants to merge 5 commits into
keshavdandeva wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the OpenTelemetry integration in the BigQuery JDBC driver by introducing a dedicated TelemetryTransportConfig and TelemetrySdkCacheKey to improve SDK lifecycle management and configuration isolation. It also adds a shutdown hook for SDKs and enhances credential resolution. The review comments provide valuable suggestions for hardening the code against potential runtime exceptions, such as security manager restrictions, invalid proxy configurations, and file path errors, all of which are actionable and should be addressed.
This was referenced Dec 2, 2026
Base automatically changed from
fix/jdbc-telemetry-v2-1-proxy-ssl-utils
to
main
December 3, 2026 13:31
…ial scoping and cache isolation
…xceptions in BigQueryConnection
…K, scoping, and cache key
…portConfig and checked trace exceptions
keshavdandeva
force-pushed
the
fix/jdbc-telemetry-v2-2a-otel-programmatic-sdk
branch
from
December 3, 2026 13:31
bc467ee to
29e17fa
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
AutoConfiguredOpenTelemetrySdkwith a programmaticOpenTelemetrySdkfor the driver-owned trace exporter, isolates trace export from ambientOTEL_*configuration, fixes OAuth scoping and SDK cache principal isolation, and manages SDK shutdown through a single JVM shutdown hook.Key Decisions
OpenTelemetrySdkover autoconfigure: RemovingAutoConfiguredOpenTelemetrySdk(and itsopentelemetry-sdk-extension-autoconfigure/opentelemetry-sdk-extension-autoconfigure-spidependencies) prevents ambientOTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS, andOTEL_TRACES_EXPORTERsettings from hijacking the driver's Google bearer tokens or leaking third-party vendor headers to Google endpoints, while honoringotel.exporter.otlp.protocol/OTEL_EXPORTER_OTLP_PROTOCOL(grpcdefault,http/protobufopt-in).TelemetryTransportConfigvalue object: Centralizes connection-level telemetry credentials, OAuth/override/proxy properties, andHttpTransportFactoryresolution soBigQueryConnectionpasses one immutable config object intoBigQueryJdbcOpenTelemetry.TelemetrySdkCacheKey: Keys trace SDKs on project ID, protocol, OAuth2 token URI override, proxy host/port, and hashed driver authentication settings (using file path + mtime/size metadata for key files to detect rotation without reading key bytes on cache hits). Log-only SDKs configure no exporters and key solely onprojectId.ConcurrentHashMap.compute.Behavior Changes
BigQueryJdbcOpenTelemetryconstructsOtlpGrpcSpanExporter(https://telemetry.googleapis.com:443) orOtlpHttpSpanExporter(https://telemetry.googleapis.com:443/v1/traces, retaining unauthenticated HTTPProxyOptionswhen configured) directly without consulting ambientOTEL_*endpoint/header/exporter properties.https://www.googleapis.com/auth/cloud-platform-scoped credential for OTLP trace export without mutating the connection's query credentials.gcpTelemetryCredentialsno longer collide on an empty-string cache key and share one principal's SDK.BigQueryJdbcException(SQLException) instead of uncheckedBigQueryJdbcRuntimeException.opentelemetry-sdk-extension-autoconfigureandopentelemetry-sdk-extension-autoconfigure-spidependencies frompom.xml.