Repository navigation
fix(bigquery-jdbc): propagate universeDomain, proxy, and SSLTrustStore to OpenTelemetry trace export - #15372
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for custom universe domains and SSL TrustStore configurations within the JDBC driver's OpenTelemetry trace exporter. Key changes include the propagation of universe domain and SSL TrustStore properties to the telemetry transport configuration, lazy validation of Compute Engine-backed credential universes on the exporter thread, and isolation of cached SDK instances using these new dimensions in the cache key. Additionally, the driver now explicitly rejects the built-in trace exporter when authenticated HTTP proxies are used. Extensive unit tests have been added to verify these behaviors under various network and credential configurations. No review comments were provided, so there is no feedback to address.
…e to OpenTelemetry trace export
…LTrustStore trace export
…tryTransportConfig
…propagation in BigQueryConnectionTest
b1e477a to
76ff29e
Compare
Summary
Propagates per-connection
universeDomain, HTTP proxy routing, and customSSLTrustStore*settings to the driver-owned OpenTelemetry trace exporter, enforces fail-closed credential universe validation, and extendsTelemetrySdkCacheKeywith universe domain and TrustStore isolation.Key Decisions
universeDomainsyntax and rejects mismatched credential universes at connect time with a checkedBigQueryJdbcExceptionbefore attaching any bearer token. Compute Engine-backed credentials (including impersonated Compute Engine credentials) defer the universe check to the exporter thread to avoid metadata server probes on the connect path, memoizing valid/mismatch outcomes while retrying transientIOExceptions.http/protobuf; authenticated proxy fails fast:OtlpGrpcSpanExporterdoes not support proxy configuration, so when an unauthenticated proxy is configured the trace exporter switches toOtlpHttpSpanExporterwithProxyOptions. Because OTelProxyOptionsdoes not supportProxy-Authorization, enabling the built-in trace exporter withProxyUid/ProxyPwdfails fast with a checkedBigQueryJdbcExceptioninstructing callers to disableenableGcpTraceExporter, useuseGlobalOpenTelemetry=true, or pass a customOpenTelemetryinstance (while log-only configurations remain unaffected).SSLTrustStore*on both HTTP and gRPC exporters: ConfiguressetSslContext(sslContext, trustManager)viaBigQueryJdbcProxyUtility.createSslConfig(...)for bothOtlpHttpSpanExporterandOtlpGrpcSpanExporter, wrapping load failures as checkedBigQueryJdbcException.targetUniverseDomainand hashed TrustStore identity (file path + mtime/size + type/provider/password hash) toTelemetrySdkCacheKey.forTrace(...)so connections in different universes or with different/rotated TrustStores never share a cached SDK.Behavior Changes
https://telemetry.<universeDomain>:443(gRPC) orhttps://telemetry.<universeDomain>:443/v1/traces(http/protobuf), defaulting togoogleapis.com.ProxyHost/ProxyPort(unauthenticated) automatically usehttp/protobuffor trace export even whenotel.exporter.otlp.protocol=grpc.ProxyUid/ProxyPwd) andenableGcpTraceExporter=truefail fast with a checkedBigQueryJdbcExceptionat connect time.SSLTrustStore*properties, andTelemetrySdkCacheKeyisolates cached SDKs acrosstargetUniverseDomainand TrustStore configuration/rotation.