-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(bigquery-jdbc): OpenTelemetry integration in BQ JDBC #12902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
keshavdandeva
wants to merge
34
commits into
main
Choose a base branch
from
jdbc/feature-branch-otel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a33f3fe
feat(jdbc): basic OpenTelemetry tracing integration for BigQuery JDBC…
keshavdandeva c7131f9
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 57a0207
feat(bqjdbc): extend OpenTelemetry instrumentation for metadata and p…
keshavdandeva 20bb4f9
test(bqjdbc): add unit tests for OTel tracing (#12943)
keshavdandeva e086579
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 6a80dee
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva ba40e4c
chore: fix lint
keshavdandeva 91f008b
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva c1a3123
fix: merge conflicts
keshavdandeva e93f00b
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 077ec28
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 919183a
chore: fix merge conflicts
keshavdandeva 1adc224
feat(bqjdbc): Implement Correlated OpenTelemetry Logging Bridge (#13002)
keshavdandeva 22682ef
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 6d83984
fix: lint
keshavdandeva 2805455
chore: fix tests regarding BigQueryJdbcMdc.registerInstance()
keshavdandeva c4efa0f
feat(bqjdbc): implement OTel SDK and exporting traces and logs to gcp…
keshavdandeva e5996c4
Merge branch 'origin/main' into jdbc/otel-sdk-and-export-traces-impl
keshavdandeva 27ed8de
feat(bqjdbc): Complete OpenTelemetry instrumentation and context prop…
keshavdandeva 22b18b1
Merge remote-tracking branch 'origin/main' into jdbc/feature-branch-otel
logachev 6176a4a
Merge remote-tracking branch 'origin/main' into jdbc/feature-branch-otel
logachev a0312c7
fix: lint
keshavdandeva b6d8f63
test(bigquery-jdbc): add e2e otel test and code refinements (#13226)
keshavdandeva 568c616
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 051c352
chore(bigquery-jdbc): link OpenTelemetry instrumentation with underly…
keshavdandeva 8bc5ce1
fix(bigquery-jdbc): feature branch failing tests (#13287)
keshavdandeva 67b84ef
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva bde32cf
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 6cb06cf
chore: lint
keshavdandeva a4a8dc0
feat(bigquery-jdbc): support custom OTel credentials and dynamic toke…
keshavdandeva 1ad9e14
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva 074a844
fix failing tests
keshavdandeva b33249f
Merge branch 'main' into jdbc/feature-branch-otel
keshavdandeva e680572
fix(bigquery-jdbc): fix shading exclusions and telemetry credentials …
keshavdandeva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.google.cloud.bigquery.jdbc; | ||
|
|
||
| import io.opentelemetry.api.OpenTelemetry; | ||
| import io.opentelemetry.api.trace.Tracer; | ||
|
|
||
| public class BigQueryJdbcOpenTelemetry { | ||
|
|
||
| static final String INSTRUMENTATION_SCOPE_NAME = "com.google.cloud.bigquery.jdbc"; | ||
|
|
||
| private BigQueryJdbcOpenTelemetry() {} | ||
|
|
||
| /** | ||
| * Initializes or returns the OpenTelemetry instance based on hybrid logic. Prefer | ||
| * customOpenTelemetry if provided; fallback to an auto-configured GCP exporter if requested. | ||
| */ | ||
| public static OpenTelemetry getOpenTelemetry( | ||
| boolean enableGcpTraceExporter, | ||
| boolean enableGcpLogExporter, | ||
| OpenTelemetry customOpenTelemetry) { | ||
| if (customOpenTelemetry != null) { | ||
| return customOpenTelemetry; | ||
| } | ||
|
|
||
| if (enableGcpTraceExporter || enableGcpLogExporter) { | ||
| // TODO(b/491238299): Initialize and return GCP-specific auto-configured SDK | ||
| return OpenTelemetry.noop(); | ||
| } | ||
|
|
||
| return OpenTelemetry.noop(); | ||
| } | ||
|
|
||
| /** Gets a Tracer for the JDBC driver instrumentation scope. */ | ||
| public static Tracer getTracer(OpenTelemetry openTelemetry) { | ||
| return openTelemetry.getTracer(INSTRUMENTATION_SCOPE_NAME); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.