Skip to content

fix(bigquery-jdbc): pass connection proxy settings to OpenTelemetry exporters - #14011

Open
keshavdandeva wants to merge 7 commits into
mainfrom
jdbc/otel-proxy-fix
Open

fix(bigquery-jdbc): pass connection proxy settings to OpenTelemetry exporters#14011
keshavdandeva wants to merge 7 commits into
mainfrom
jdbc/otel-proxy-fix

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

b/543818095

Changes

  1. Driver Implementation (BigQueryJdbcOpenTelemetry.java & BigQueryConnection.java):

    • Trace Exporter Proxy Support: Passed proxyProperties to getOpenTelemetry(...), configuring ProxyOptions (via custom ProxySelector) on OtlpHttpSpanExporterBuilder.
    • Cache Key Isolation: Added proxyHost and proxyPort to SdkCacheKey so different proxy configurations receive dedicated OpenTelemetry SDK instances.
    • Telemetry Metadata: Passed this.headerProvider to createLoggingClient(...) for telemetry attribution.
  2. Integration Tests (ITOpenTelemetryTest.java):

    • Added testExecute_withHttpProtocol_andDirectTraceVerification() to verify OpenTelemetry HTTP trace delivery end-to-end through proxies directly via Cloud Trace API (independent of Cloud Logging).
    • Refactored verifyAndFetchTrace(...) to automatically route TraceServiceClient requests through proxy tunnels when ProxyHost/ProxyPort are present on the connection URL.
  3. Unit Tests:

    • Updated BigQueryConnectionTest.java and BigQueryJdbcOpenTelemetryTest.java to match new method signatures.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces proxy support for OpenTelemetry HTTP span exporters and configures transport options and header providers for the GCP Logging client. Specifically, it parses proxy properties from the connection settings and applies them when building the OtlpHttpSpanExporter. The review feedback suggests adding validation and error handling when parsing the proxy port to prevent potential NumberFormatException or out-of-bounds port values from causing abrupt connection failures.

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds proxy support for OpenTelemetry HTTP span exporters in the BigQuery JDBC driver by parsing, caching, and applying proxy configurations during SDK initialization. It also updates the logging client to support a HeaderProvider. The feedback suggests improving the robustness of the proxy configuration parsing by adding null/empty checks, handling potential number format exceptions, and using unresolved socket addresses to avoid blocking DNS resolution.

@keshavdandeva
keshavdandeva marked this pull request as ready for review August 8, 2026 00:49
@keshavdandeva
keshavdandeva requested review from a team as code owners August 8, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant