Skip to content

feat(jdbc): OpenTelemetry integration in BQ JDBC#12902

Draft
keshavdandeva wants to merge 2 commits intomainfrom
jdbc/feature-branch-otel
Draft

feat(jdbc): OpenTelemetry integration in BQ JDBC#12902
keshavdandeva wants to merge 2 commits intomainfrom
jdbc/feature-branch-otel

Conversation

@keshavdandeva
Copy link
Copy Markdown
Contributor

This is a feature branch. Please do not merge to main.

… Statement (#12124)

b/491239772
b/491239773

### Changes

- New connection properties: `enableGcpTraceExporter` (Boolean, default:
false) and `enableGcpLogExporter` (Boolean, default: false)

- `customOpenTelemetry` (Instance): Programmatic injection of a custom
SDK (User Application-Managed setup) via
`BigQueryDataSource.setCustomOpenTelemetry()`

- Added the core initialization logic for `OpenTelemetry`. During
connection setup, it evaluates whether tracing is enabled and constructs
an OpenTelemetry Tracer instance. Then, it passes this newly minted
tracer strictly downward into the core `BigQueryOptions.Builder` via
`.setOpenTelemetryTracer()`

- Intercepted the execution functions (`execute`, `executeQuery`,
`executeLargeUpdate`, `executeBatch`) to spawn child spans wrapping each
database call.
@keshavdandeva keshavdandeva added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 23, 2026
Copy link
Copy Markdown
Contributor

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

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 integrates OpenTelemetry into the BigQuery JDBC driver, enabling tracing for core operations such as query execution, batch updates, and background data processing tasks like pagination and Arrow stream processing. It adds support for custom OpenTelemetry instances and introduces configuration flags for GCP trace and log exporters. The review feedback recommends performance optimizations by using static tracer constants, better adherence to OpenTelemetry semantic conventions for database spans (e.g., setting db.system and SpanKind), and improving user feedback when certain exporter features are still under development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant