Repository navigation
fix(bigquery-jdbc): migrate direct Cloud Logging to GAPIC LoggingClient - #15373
Open
keshavdandeva wants to merge 4 commits into
Open
keshavdandeva wants to merge 4 commits into
keshavdandeva wants to merge 4 commits into
Conversation
This was referenced Dec 2, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces GcpLogWriter, a package-private direct Google Cloud Logging writer backed by the GAPIC LoggingClient, replacing the previous usage of com.google.cloud.logging.Logging across the JDBC driver. Feedback on these changes focuses on enhancing robustness and performance within GcpLogWriter. Specifically, it is recommended to catch all exceptions during log writes to prevent runtime exceptions from propagating to the application thread, add defensive null checks during environment resource detection to avoid potential NullPointerExceptions, and reuse the ApiFuture instance as the key in pendingWrites to reduce object allocation overhead.
…nt via GcpLogWriter
…HandlerTest for GAPIC logging
… BigQueryConnection
…ifecycle and cleanup
keshavdandeva
force-pushed
the
fix/jdbc-telemetry-v2-3b-gapic-cloud-logging
branch
from
December 3, 2026 13:31
3b2ce48 to
4c9ea3e
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
Migrates direct Cloud Logging export (
enableGcpLogExporter=true) from the legacycom.google.cloud.logging.Loggingclient to the GAPICcom.google.cloud.logging.v2.LoggingClientvia a package-privateGcpLogWriter, enabling per-connection gRPC proxy (including authenticated proxies),SSLTrustStore*,universeDomain, and OAuth scope/override propagation.Key Decisions
LoggingClientviaGcpLogWriter: LegacyGrpcLoggingRpcbuilds its own channel fromLoggingOptions.getHost()and cannot accept aTransportChannelProvider. PassingBigQueryConnection'stransportChannelProviderinto GAPICLoggingSettingsroutes Cloud Logging through the exact same HTTP CONNECT proxy (authenticated or unauthenticated) andSSLTrustStore*channel configuration as BigQuery Storage gRPC clients.TelemetryTransportConfig.resolveCredentials("https://www.googleapis.com/auth/logging.write")so BigQuery-only credentials derive alogging.write-scoped credential without mutating query credentials and reject mismatched universe domains with checkedBigQueryJdbcException.ThrowExceptionflow-control behavior to drop overflow entries instead of stalling JDBC threads, guards against re-entrant JUL logging with aThreadLocal, logs the first write failure once and summarizes total dropped writes on close, and enforces a bounded 6-second flush deadline (shutdownNow()on timeout/interruption) with a single shared deadline across writers inOpenTelemetryJulHandler.flush().MonitoredResourcedetection: Caches host environment detection once per JVM (stampingproject_idper connection) to avoidMonitoredResourceUtil's unsynchronized cache and repeated metadata probes.Behavior Changes
ProxyHost/ProxyPort/ProxyUid/ProxyPwd,SSLTrustStore*,universeDomain,EndpointOverrides(OAUTH2),HeaderProvider, andlogging.writeOAuth scoping.OpenTelemetryJulHandlerdelegates direct Cloud Logging writes toGcpLogWriter, propagatingtraceId,spanId, andtraceSampled.BigQueryJdbcException(SQLException), andBigQueryConnection's constructorfinallyblock releases any cached OpenTelemetry SDK ifGcpLogWriter.create(...)fails.BigQueryJdbcOpenTelemetry.createLoggingClient(...).