Repository navigation
fix(bigquery-jdbc): suppress Clearcut diagnostic telemetry for custom universes and endpoint overrides - #15395
keshavdandeva wants to merge 13 commits into
Conversation
…ueryConnection after credential resolution
…and endpoint overrides
…ectionTest tearDown
…andlerTest tearDown
…andlerTest tearDown
…rrides, credentials, and failures
…ce, env, and credential universes
…andlerTest tearDown
…andlerTest tearDown
…, endpoint overrides, and credential realms
…ryManager entry point
There was a problem hiding this comment.
Code Review
This pull request introduces the BigQueryJdbcDiagnosticTelemetry class to coordinate Clearcut diagnostic telemetry eligibility and lifecycle transitions for BigQuery JDBC connections. It refactors BigQueryConnection and BigQueryDriver to delegate telemetry initialization, suppression checks, and failed connection recording to this new coordinator. Additionally, it updates TelemetryManager and TelemetryConfiguration to support explicit boolean overrides and adds comprehensive unit tests to validate telemetry suppression rules under various configurations. There are no review comments, so I have no feedback to provide.
logachev
left a comment
There was a problem hiding this comment.
It will conflict with changes to URI parsing. Let's wait for another PR to be merged first, it will require changes.
…guration builder methods
Stacked on #15394.
Summary
Suppresses Clearcut diagnostic telemetry whenever a connection targets a non-default universe domain, custom endpoint override, or Private Service Connect URI, and moves telemetry initialization to
BigQueryConnectionafter credentials are resolved.Key changes
BigQueryJdbcDiagnosticTelemetry: Evaluates suppression (EndpointOverrides,PrivateServiceConnectUris, resolveduniverseDomain/GOOGLE_CLOUD_UNIVERSE_DOMAIN, and credential universe domain) and opt-out rules for both established connections andBigQueryDriver.connectfailures.BigQueryConnection&BigQueryDriver: Replaces earlyTelemetryManager.getInstance(...)initialization inBigQueryDriver.connectwithBigQueryJdbcDiagnosticTelemetry.initializeOrDisable(...)right after credential resolution inBigQueryConnection, and routes connection failures throughBigQueryJdbcDiagnosticTelemetry.recordFailedConnection(...).BigQueryJdbcUrlUtility: AddsparseLastUriPropertyWithoutValidationso raw URI fallback parsing on failed connects uses last-wins semantics matchingparseUrl.TelemetryManager&TelemetryConfiguration: Adds typed@InternalApientry points (initializeForConnection(Boolean),disableGlobally(String)) andresolveEnabled(Boolean)so eligibility checks do not round-trip booleans throughProperties.DataSource, environment variables, credential universes, and failed connections, and ensures telemetry state is reset in test teardown.Decisions made
BigQueryJdbcOAuthUtility.getCredentials(...)ensures credential-declared universe domains are evaluated before any Clearcut transport starts.credentials.getUniverseDomain()forComputeEngineCredentials(includingImpersonatedCredentialschains backed by GCE) to avoid blocking on the metadata server; explicituniverseDomainandGOOGLE_CLOUD_UNIVERSE_DOMAINoverrides still apply.DataSource.fromUrlinspect the raw URI with last-wins semantics and fail closed ifEnableDiagnosticTelemetryis malformed.TelemetryManageris a process-wide singleton shared across connections, any suppressed or opted-out connection disables telemetry for the JVM without flushing queued events.