GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(bigquery-jdbc): OpenTelemetry integration in BQ JDBC by keshavdandeva · Pull Request #12902 · googleapis/google-cloud-java

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Apr 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

b/342411096

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@keshavdandeva
feat(jdbc): basic OpenTelemetry tracing integration for BigQuery JDBC…
a33f3fe
… 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
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
c7131f9
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 23, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ogle-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ogle-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

keshavdandeva and others added 19 commits April 28, 2026 15:31
@keshavdandeva
feat(bqjdbc): extend OpenTelemetry instrumentation for metadata and p…
57a0207
…agination (#12918)

b/491245568

### Key Changes

#### Core Instrumentation Logic
* **Database Metadata Tracing**: Added OTel spans to key methods in
`BigQueryDatabaseMetaData.java` (`getCatalogs`, `getSchemas`,
`getTables`, `getColumns`) to capture underlying API calls.
* **Pagination Span Links**: Captured the parent span context at the
start of `fetchNextPages` in `BigQueryStatement.java` and linked
background pagination spans back to it, avoiding timeline anomalies.
* **Cross-Thread Context Propagation**: Stored the `SpanContext` in
`BigQueryBaseResultSet.java` at creation time and made it current during
`next()` in `BigQueryJsonResultSet.java` and
`BigQueryArrowResultSet.java` to survive thread hops.
* **Tracer Reuse**: Extracted `getSafeTracer` to
`BigQueryJdbcOpenTelemetry.java` as a static utility to ensure
consistent fallback behavior across the driver.
* **Lambda Extraction**: Extracted the large lambda function in
`populateArrowBufferedQueue` in `BigQueryStatement.java` to its own
private method `processArrowStream` to improve readability and
maintainability.
@keshavdandeva
test(bqjdbc): add unit tests for OTel tracing (#12943)
20bb4f9
b/491245568

### Changes

#### Enhanced Unit Testing Infrastructure
- `OpenTelemetryTestUtility`: Introduced a shared utility to simplify
complex OTel assertions
- `BigQueryStatementTest`: Added comprehensive parameterised tracing
tests for all execution paths, including attribute validation for
queries and batch operations.
- `BigQueryDatabaseMetaDataTest`: Instrumented all metadata discovery
methods and added corresponding unit tests to verify span generation
using parameterised tests
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
e086579
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
6a80dee
@keshavdandeva
chore: fix lint
ba40e4c
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
91f008b
@keshavdandeva
fix: merge conflicts
c1a3123
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
e93f00b
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
077ec28
@keshavdandeva
chore: fix merge conflicts
919183a
@keshavdandeva
feat(bqjdbc): Implement Correlated OpenTelemetry Logging Bridge (#13002)
1adc224
b/496678357

This PR implements the **Correlated GCP Logging Bridge** for the
OpenTelemetry integration in the BigQuery JDBC driver. It enables
bridging standard Java logs (`java.util.logging`) to the OpenTelemetry
Logs API, allowing users to correlate logs with distributed traces and
isolate them by connection session.

### Changes

- `BigQueryDriver.java`: Implemented Cloud-Only Mode matrix logic to
suppress local file creation when `enableGcpLogExporter=true` and
`LogPath` is omitted.
- `BigQueryJdbcRootLogger.java`: Updated `setLevel` to handle
`Level.OFF` properly and skip file handler creation if path is null.
- `BigQueryConnection.java`: Attached `OpenTelemetryJulHandler` to the
`"com.google.cloud.bigquery"` namespace during initialization.
- `OpenTelemetryJulHandler.java`: Created a new handler that bridges JUL
logs to OTel Logs API with context harvesting and connection ID
filtering.
- `pom.xml`: Added `google-cloud-logging` dependency with version
`3.33.0-SNAPSHOT` and auto-update marker.
- `OpenTelemetryJulHandlerTest.java`: Created unit tests using
`OpenTelemetryExtension` to verify log emission and filtering.
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
22682ef
@keshavdandeva
fix: lint
6d83984
@keshavdandeva
chore: fix tests regarding BigQueryJdbcMdc.registerInstance()
2805455
@keshavdandeva
feat(bqjdbc): implement OTel SDK and exporting traces and logs to gcp (…
c4efa0f
…#13039)

b/491238299
b/511147053

This PR completes the implementation of the OpenTelemetry SDK lifecycle
and cross-project authentication for the BigQuery JDBC driver. It
introduces thread-safe caching of heavy OTel SDK instances to support
multi-project tracing without global side effects.

### Changes

#### `BigQueryJdbcOpenTelemetry.java`
- A `ConcurrentHashMap` caches `OpenTelemetrySdk` instances, keyed by a
concatenated string of `ProjectId` and `Credentials`
- The `getOpenTelemetry()` method lazily loads and initializes the SDK
only when requested and not present in the cache.
- A JVM shutdown hook closes each cached SDK to ensure pending traces
are flushed on application exit.

#### `BigQueryJdbcUrlUtility.java`
- `gcpTelemetryCredentials` and `gcpTelemetryProjectId` are added to
connection properties.

#### `BigQueryJdbcOAuthUtility.java`
- The `isJson()` helper method is changed from private to
package-private to allow reuse in `BigQueryJdbcOpenTelemetry.`

#### `BigQueryConnection.java`
- Added new connection properties to be used
- Uses `Boolean.TRUE.equals()` when checking `enableGcpLogExporter` and
`enableGcpTraceExporter` to safely handle cases where these properties
are not specified `null` and avoid `NullPointerException` during
auto-unboxing.

#### `BigQueryJdbcOpenTelemetryTest.java`
- New unit tests verify that SDK instances are correctly cached for
identical keys and isolated for different keys.

#### `BigQueryArrowStructTest.java`
- A fix is applied to avoid varargs ambiguity in array creation,
resolving a specific coercion failure in the structOfArrays test.
@keshavdandeva
Merge branch 'origin/main' into jdbc/otel-sdk-and-export-traces-impl
e5996c4
@keshavdandeva
feat(bqjdbc): Complete OpenTelemetry instrumentation and context prop…
27ed8de
…agation (#13187)

b/496720140

## Changes

### Context Propagation & Session Tracking
* **Baggage Injection**: Injected the generated Connection UUID into
OpenTelemetry Baggage upon `BigQueryConnection` initialization to enable
reliable log correlation.
* **Log Handler Update**: Updated `OpenTelemetryJulHandler` to rely on
Baggage for retrieving the connection ID, removing the legacy MDC
fallback.
* **Thread Pool Audit**: Wrapped tasks submitted to background executors
in `BigQueryDatabaseMetaData` with `Context.current().wrap()`, ensuring
trace context is not lost during parallel metadata fetching.

### Span Enrichment & Semantic Conventions
* **Attributes**: Enriched JDBC spans with standard attributes:
`db.system = "bigquery"`, `db.connection_id`, and `db.application`
(derived from `partnerToken` or falling back to
`"Google-BigQuery-JDBC-Driver"`).
* **Scope Separation**: Implemented separate tracers for the JDBC driver
(`com.google.cloud.bigquery.jdbc`) and the SDK
(`com.google.cloud.bigquery`) to allow clean filtering in tracing UIs
while maintaining correlation.

### Instrumentation
* **PreparedStatement**: Added missing instrumentation for
`BigQueryPreparedStatement` execution methods (`execute`,
`executeQuery`, `executeLargeUpdate`) to generate spans.

### Refactoring & Cleanups
* **Centralized Tracing**: Created a centralized `withTracing` helper in
`BigQueryJdbcOpenTelemetry.java` to eliminate duplicated tracing logic
in `BigQueryStatement` and `BigQueryDatabaseMetaData`.
* **Constants**: Defined all semantic convention keys as constants in
`BigQueryJdbcOpenTelemetry.java` to eliminate magic strings from method
bodies.
* **Simplifications**: Simplified redundant boolean checks in
`BigQueryConnection.java`.
@logachev
Merge remote-tracking branch 'origin/main' into jdbc/feature-branch-otel
22b18b1
# Conflicts:
#	java-bigquery/google-cloud-bigquery-jdbc/pom.xml
#	java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
#	java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java
#	java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java
#	java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java
#	java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
#	java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java
@logachev
Merge remote-tracking branch 'origin/main' into jdbc/feature-branch-otel
6176a4a
# Conflicts:
#	java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java
#	java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/OpenTelemetryJulHandler.java
#	java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetryTest.java
#	java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/OpenTelemetryJulHandlerTest.java
#	java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/OpenTelemetryTestUtility.java
@logachev
logachev force-pushed the jdbc/feature-branch-otel branch from 7bebb0f to 6176a4a Compare May 22, 2026 05:02
keshavdandeva and others added 6 commits May 22, 2026 13:24
@keshavdandeva
fix: lint
a0312c7
@keshavdandeva @cloud-java-bot @logachev
test(bigquery-jdbc): add e2e otel test and code refinements (#13226)
b6d8f63
b/499079838

### Changes

#### 1. BigQueryJdbcOpenTelemetry.java
* **Feature**: Added safe, generous default attribute value length
limits of **`60KB (61,440 characters)`** to the autoconfigured
OpenTelemetry instance properties.
* **Why**: Prevents GCP Cloud Trace from silently rejecting and dropping
span batches when we log massive `BigQueryException` stack traces or
Arrow schema payloads exceeding the hard 64KB Cloud Trace backend
limits.
* **Design**: If the user explicitly configures their own limits the
driver automatically skips the defaults and respects their overrides.

#### 2. OpenTelemetryJulHandler.java
* **Fix**: Configured the handler level to `Level.ALL` in the
constructor.
* **Why**: Bypasses a standard Java Logging (JUL) constraint where
handlers default to `Level.INFO` and silently drop `FINE`/`DEBUG`
queries. Delegates log filtering exclusively to the Connection loggers.

#### 3. BigQueryConnection.java
* **Visibility**: Exposed the visibility of the connection session
identifier by changing `getConnectionId()` from package-private to
`public`.
* **Why**: Allows automated E2E tests to retrieve the UUID and harvest
specific logs/traces accurately.

#### 4. ITOpenTelemetryTest.java
* **Feature**: Implemented a new standalone E2E integration test suite
verifying the live GCP OTel egress.
* **Test 1 (`testExecute_withOpenTelemetryGcpExporter`)**: Natively
resolves target project via `ServiceOptions.getDefaultProjectId()`. Runs
an optimized in-memory array query and iterates results to trigger
small-page JSON pagination. Queries Cloud Trace E2E to strictly assert
that async pagination child spans are parented perfectly under the root
JDBC span.
* **Test 2 (`testExecute_withErrorCorrelation`)**: Triggers database
failures, captures `SQLException`, harvests Trace IDs from standard
logs, and verifies failed span ingestion in Cloud Trace.

#### 5. BigQueryConnectionTest.java
* **Feature**: Added a new unit test
(`testConnect_withCustomOpenTelemetry_usesCustomInstance`) verifying the
custom OTel injection pipeline.
* **What it does**: Leverages `OpenTelemetryExtension` to mock an OTel
provider locally. Injecting the custom SDK via properties, it validates
that `BigQueryConnection` resolves the instance and routes spans
exclusively to the custom provider

#### 6. pom.xml
* **Dependencies**: Added `google-cloud-trace` test-scoped dependency to
query Cloud Trace v1 API programmatically during E2E validation.

---------

Co-authored-by: cloud-java-bot <[email protected]>
Co-authored-by: Kirill Logachev <[email protected]>
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
568c616
@keshavdandeva
chore(bigquery-jdbc): link OpenTelemetry instrumentation with underly…
051c352
…ing SDK (#13293)

b/517588332

This PR completes the linkage between the JDBC driver's OpenTelemetry
instrumentation and the underlying BigQuery SDK to ensure full
end-to-end traces.

## Key Changes
- **Dependency**: Added `io.grpc:grpc-opentelemetry` to intercept
low-level gRPC network spans for the Storage API.
- **REST API**: Enabled `setEnableOpenTelemetryTracing(true)` in
`BigQueryOptions` to unlock SDK-level tracing for standard queries.
- **HTAPI (Storage API)**: Enabled `setEnableOpenTelemetryTracing(true)`
in `BigQueryReadSettings` and wired the `GrpcOpenTelemetry` interceptor
to the channel builder.
- **Global OTel**: Ensured the `useGlobalOpenTelemetry` flag is
respected when configuring the Storage API client.
@keshavdandeva
fix(bigquery-jdbc): feature branch failing tests (#13287)
8bc5ce1
b/517498094

This PR fixes dependency analysis failures and flaky test issues
identified in the OpenTelemetry integration feature branch.
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
67b84ef
keshavdandeva added 2 commits July 21, 2026 14:58
@keshavdandeva
Merge main into OpenTelemetry branch
2cb326f
@keshavdandeva
Fix formatting issues
b919654
@keshavdandeva keshavdandeva removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 21, 2026
keshavdandeva added 4 commits July 22, 2026 14:57
@keshavdandeva
Fix unit tests after merge; restore OTEL spans
0ae587e
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
a93ba7c
@keshavdandeva
fix pom
a09be3d
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
fea7a83
@keshavdandeva
keshavdandeva marked this pull request as ready for review July 22, 2026 22:34
@keshavdandeva
keshavdandeva requested review from a team as code owners July 22, 2026 22:34
keshavdandeva added 2 commits July 23, 2026 22:01
@keshavdandeva
fix(bigquery-jdbc): fix minor issues and run integration tests for ot…
474c626
…el (#13866)

b/537284101

This PR fixes multiple OpenTelemetry resource leaks.

### Key Changes
1. **Fix Thread Leaks (Reference Counting):** Wrapped `OpenTelemetrySdk`
in a `CachedSdk` to track usage. The SDK and its background threads are
now explicitly closed when the last JDBC `Connection` using them is
closed.
2. **Fix Classloader Leaks:** Removed the redundant
`Runtime.addShutdownHook` in `BigQueryJdbcOpenTelemetry`. This prevents
severe `Metaspace` memory leaks when the driver is undeployed in
Application Servers (like Tomcat/JBoss).
3. **Fix Service Account Path Fallback:** Updated
`resolveEffectiveCredentials()` to properly detect
`OAUTH_PVT_KEY_PATH_PROPERTY_NAME` (key file paths), preventing
erroneous fallbacks to Application Default Credentials.
4. **Fix Test Quota Limits:** Increased the polling delay in
`ITOpenTelemetryTest` from 500ms to 3000ms. This prevents the GCP
Logging API from rejecting the test with `RESOURCE_EXHAUSTED` (Status
429) errors due to exceeding the 60 requests/minute quota limit.
5. **Fix ADC support**
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
b94cd10
@keshavdandeva
keshavdandeva requested review from Neenu1995 and logachev July 23, 2026 20:14
keshavdandeva added 4 commits July 24, 2026 02:06
@keshavdandeva
increase polling time for integration test
577a93e
@keshavdandeva
Merge branch 'main' into jdbc/feature-branch-otel
90adabe
@keshavdandeva
fix java 8 unit tests
360f66a
@keshavdandeva
fix: resolve otel credential scoping and remove auth lib dependency
d92e627
@keshavdandeva
keshavdandeva enabled auto-merge (squash) July 24, 2026 15:23
@keshavdandeva
fix dependency check
07236e7
Neenu1995
Neenu1995 reviewed Jul 24, 2026
View reviewed changes
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java Outdated
import java.util.logging.Handler;
import java.util.logging.Logger;

public class BigQueryJdbcOpenTelemetry {

@Neenu1995 Neenu1995 Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: Typically the JDBC specific files are package private.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

keshavdandeva reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@keshavdandeva keshavdandeva Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/OpenTelemetryJulHandler.java Outdated
LogEntry.Builder builder =
LogEntry.newBuilder(Payload.StringPayload.of(formatMessage(record)))
.setSeverity(mapGcpSeverity(record.getLevel()))
.setTimestamp(record.getMillis())

@Neenu1995 Neenu1995 Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This method maybe deprecated in the Logging Library. Please double check.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@keshavdandeva keshavdandeva Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yes, it was deprecated. Fixed it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java
@@ -151,15 +151,17 @@ public static Logger getRootLogger() {

@Neenu1995 Neenu1995 Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Future PR: Add the trace and span IDs to the log file Formatter

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

keshavdandeva reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@keshavdandeva keshavdandeva Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Created b/538631816

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/OpenTelemetryJulHandler.java Outdated
Baggage.fromContext(Context.current())
.getEntryValue(BigQueryJdbcOpenTelemetry.CONNECTION_ID_BAGGAGE_KEY);

if (connectionId == null) {

@Neenu1995 Neenu1995 Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is dropping the logs when the connection id is available from BigQueryJdbcMdc.getConnectionId();. It can even fallback to LogRecord for the connection ID. Only drop logs if, connection ID is not available from anywhere.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

keshavdandeva reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@keshavdandeva keshavdandeva Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, added the connectionId = BigQueryJdbcMdc.getConnectionId(); check as well

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java Outdated
gcpTelemetryProjectId,
getCredentialsIdentifier(gcpTelemetryCredentials),
enableGcpTraceExporter);
return sdkCache.compute(

@Neenu1995 Neenu1995 Jul 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This may be an edge case, but it might be a good idea to pre-compute the heavy work in this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

keshavdandeva reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@keshavdandeva keshavdandeva Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good catch, I moved the heavy work out of the synchronized sdkCache.compute() block to prevent it from blocking other threads during a cache miss

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@keshavdandeva
address pr feedback
5d96ae0
@keshavdandeva
keshavdandeva requested a review from Neenu1995 July 24, 2026 18:55
logachev
logachev approved these changes Jul 24, 2026
View reviewed changes
@keshavdandeva
keshavdandeva merged commit af18f65 into main Jul 24, 2026
206 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@keshavdandeva
keshavdandeva deleted the jdbc/feature-branch-otel branch July 24, 2026 19:48
@release-please release-please Bot mentioned this pull request Jul 28, 2026
chore(main): release 1.89.0 #13934
Merged
whowes pushed a commit that referenced this pull request Jul 30, 2026
@release-please
chore(main): release 1.89.0 (#13934)
c2ce8c1
🤖 I have created a release *beep* *boop*
---


<details><summary>1.89.0</summary>

##
[1.89.0](v1.88.0...v1.89.0)
(2026-07-29)


### Features

* **agentidentity:** onboard v1 and v1beta API versions
([#13796](#13796))
([1b1300d](1b1300d))
* **auth:** add JSpecify Null annotations to Auth
([#13842](#13842))
([f6f24d4](f6f24d4))
* **bigquery-jdbc:** add `SSLTrustStoreType` and `SSLTrustStoreProvider`
connection properties
([#13858](#13858))
([9449be1](9449be1))
* **bigquery-jdbc:** add otel trace and span IDs to local logs
([#13935](#13935))
([2801fbd](2801fbd))
* **bigquery-jdbc:** implement BigQueryParameterMetaData and dynamic
type mappings
([#13812](#13812))
([3d67dba](3d67dba))
* **bigquery-jdbc:** implement parameter setters in PreparedStatement
([#13792](#13792))
([94f7404](94f7404))
* **bigquery-jdbc:** Migrate `getImportedKeys` and `getCrossReference`
to BQ API
([#13692](#13692))
([082b046](082b046))
* **bigquery-jdbc:** migrate `getPrimaryKeys` to use BQ API
([#13691](#13691))
([1951f49](1951f49))
* **bigquery-jdbc:** OpenTelemetry integration in BQ JDBC
([#12902](#12902))
([af18f65](af18f65))
* **bigquery-jdbc:** optimize memory footprint for JSON result set
streaming
([#13660](#13660))
([11f26d3](11f26d3))
* **bigquery-jdbc:** standardize parameter handling and calendar
defensive copying across statement interfaces
([#13805](#13805))
([ccd13eb](ccd13eb))
* **bigtable:** add view_parameters support to BoundStatement
([#13673](#13673))
([d5cc437](d5cc437))
* **bigtable:** BigtableDataClientFactory session support
([#13829](#13829))
([284ce13](284ce13))
* **commerceproducer:** onboard v1beta API
([#13814](#13814))
([61b89b3](61b89b3))
* Default to least-in-flight balancing for Bigtable unary clients
([#13802](#13802))
([ac9ccd1](ac9ccd1))
* **firestore:** Add support for 16MB documents
([#13478](#13478))
([1b7c2e0](1b7c2e0))
* **gapic-generator:** add JSpecify Null annotations to the generator
classes
([#13769](#13769))
([843bd7c](843bd7c))
* **gapic-generator:** Add Nullable annotation to generated classes
([#13558](#13558))
([e3e9d0b](e3e9d0b))
* **gapic-generator:** Add NullMarked annotation to generated classes
([#13584](#13584))
([b7a8504](b7a8504))
* **gax-httpjson:** Add Post Quantum Cryptography (PQC) Support by
default via Conscrypt
([#13853](#13853))
([550df81](550df81))
* **gax-java:** add JSpecify Null annotations to gax
([#13799](#13799))
([65aee08](65aee08))
* **google/cloud/sql:** onboard a new library
([#13864](#13864))
([38e272e](38e272e))
* **google/maps/navconnect/v1:** onboard a new library
([#13927](#13927))
([2256394](2256394))
* **maps-isochrones:** onboard v1 API
([#13817](#13817))
([3037ab3](3037ab3))
* port secure_context testing support to executor proxy
([#13522](#13522))
([0f81bf0](0f81bf0))
* **productregistry:** onboard v1 API
([#13816](#13816))
([9517313](9517313))
* **storage:** allow checksum on appendable upload finalization
([#13833](#13833))
([ddf9add](ddf9add))
* **storage:** enable App-Centric Observability (ACO) support in Otel
([#13248](#13248))
([4329896](4329896))


### Bug Fixes

* **bigquery-jdbc:** Add PerConnectionHandler to list of excempted
logging classes
([#13888](#13888))
([50b3c24](50b3c24))
* **bigquery-jdbc:** add preferIPv4Stack to argLine for Kokoro
reliability
([#13923](#13923))
([d5e33d6](d5e33d6))
* **bigquery-jdbc:** add service resource transformer for standalone IT
([#13893](#13893))
([dc80fe8](dc80fe8))
* **bigquery-jdbc:** align metadata methods error handling with spec
([#13793](#13793))
([d85fb10](d85fb10))
* **bigquery-jdbc:** fix WriteAPI when running in restricted environment
([#13856](#13856))
([66ba925](66ba925))
* **bigquery-jdbc:** refine temporal timezone coercion and
PreparedStatement parameter setters
([#13813](#13813))
([6f68c4d](6f68c4d))
* **bigquery-jdbc:** resolve `ITOpenTelemetryTest` pipeline and trace
validation failures
([#13898](#13898))
([c18141d](c18141d))
* **bigquery-jdbc:** resolve failing otel IT in nightly
([#13915](#13915))
([ac79713](ac79713))
* **bigquery:** resultSet.getLong() does not truncate for large int64
values
([#13718](#13718))
([bc19822](bc19822))
* **bigquery:** support optional fields in BigLakeConfiguration to
prevent NPE on Iceberg/Lakehouse tables
([#13733](#13733))
([e2cca4d](e2cca4d))
* **bigtable:** add materialized view routing param to ReadRows and Sa…
([#13918](#13918))
([4ddf250](4ddf250))
* **bigtable:** bound SessionPoolImpl lock to prevent pod-wide wedge
([#13890](#13890))
([ed87a68](ed87a68))
* **bigtable:** fix session creation leaks
([#13887](#13887))
([d586d07](d586d07))
* **bigtable:** prevent ClientConfigurationManagerTest from wedging on…
([#13907](#13907))
([725086d](725086d))
* **bigtable:** stop installing DirectpathEnforcer on the directpath
pool
([#13880](#13880))
([5f2e056](5f2e056))
* **bom:** make release-note-generation Java 8 compatible
([#13837](#13837))
([bc18390](bc18390))
* **ci:** fix java-cloud-bom release-notes workflow errors
([#13682](#13682))
([b679835](b679835))
* deprecate resource detector
([#13844](#13844))
([aba4f01](aba4f01))
* **deps:** align logback versions and add java8 profile in storage
([#13678](#13678))
([7e57092](7e57092))
* do not start stream with direct executor
([#13945](#13945))
([630e790](630e790))
* fix java-cloud-bom README update workflow after monorepo migration
([#13892](#13892))
([5b8e295](5b8e295))
* **oauth2_http:** Avoid retrying on 4xx errors during GCE metadata ping
([#13715](#13715))
([537c16c](537c16c))
* regenerate
([#13714](#13714))
([8a72860](8a72860))
* regenerate libraries
([#13703](#13703))
([a29ea79](a29ea79)),
refs
[#13690](#13690)
* **release:** handle missing release tags gracefully in
release-note-generation
([#13795](#13795))
([43005fb](43005fb))
* **release:** resolve first-party-dependencies SNAPSHOT in
libraries-bom
([#13790](#13790))
([d5bfe21](d5bfe21))
* **spanner:** avoid data race on DIRECTPATH_CHANNEL_CREATED by using
volatile
([#13727](#13727))
([1e05ea5](1e05ea5))
* **spanner:** prevent fastpath tablet routing flaps
([#13803](#13803))
([4dabdac](4dabdac))
* **storage:** BidiAppendableUpload Takeover operation fixes
([#13776](#13776))
([f2d0474](f2d0474))
* **storage:** correctly insert explicit nulls for json patch updates
([#13716](#13716))
([4fb3f4b](4fb3f4b))
* update group id mapping
([#13698](#13698))
([50a72e1](50a72e1))
* use a new managed channel builder when creating channels
([#13684](#13684))
([a049999](a049999))


### Performance Improvements

* **bigquery-jdbc:** optimize getExportedKeys performance using hybrid
metadata lookup
([#13734](#13734))
([c9738ea](c9738ea))


### Dependencies

* Add Conscrypt to shared-deps
([#13838](#13838))
([05ce6ce](05ce6ce))
* move conscrypt from third-party-dependencies POM to gax-java POM
([#13948](#13948))
([1e634ec](1e634ec))
* **shared-deps:** migrate awaitility to shared-dependencies
([#13671](#13671))
([abb91ef](abb91ef))
* **shared-deps:** switch conscrypt shared dependency to
conscrypt-openjdk-uber
([#13845](#13845))
([2e3f208](2e3f208))
* Update gRPC-Java to v1.82.2
([#13877](#13877))
([da228d8](da228d8))
* Update http-client to v2.2.0
([#13854](#13854))
([334a2c5](334a2c5))
* Update Protobuf-Java to v4.33.6
([#13876](#13876))
([5c6478c](5c6478c))
* Upgrade Guava to v33.6.0-jre
([#13875](#13875))
([41a7a52](41a7a52))


### Documentation

* add ErrorProne and NullAway integration guide and JSpecify migration
playbook
([#13882](#13882))
([d5ea739](d5ea739))
* add JSpecify nullness guidelines to AGENTS.md
([#13881](#13881))
([54b846b](54b846b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@logachev logachev logachev approved these changes
@Neenu1995 Neenu1995 Awaiting requested review from Neenu1995
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@keshavdandeva @logachev @Neenu1995
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.