Skip to content

feat(gax): accept clientOptions in createApiCall for telemetry tracing - #9176

Merged
shivanee-p merged 5 commits into
mainfrom
shivaneep-o11y-client-options
Aug 25, 2026
Merged

shivanee-p merged 5 commits into
mainfrom
shivaneep-o11y-client-options

Conversation

@shivanee-p

@shivanee-p shivanee-p commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds clientOptions support and telemetry gating logic to createApiCall in google-gax to support OpenTelemetry tracing.

  • Defined StaticTraceContext and added enableTelemetryTracing?: boolean and internalTelemetryInfo?: StaticTraceContext to ClientOptions.
  • Accepted clientOptions in createApiCall and added conditional gating checking enableTelemetryTracing, internalTelemetryInfo, and GOOGLE_SDK_NODE_EXPERIMENTAL_O11Y_ENABLED.
  • Updated test helpers to forward clientOptions and added unit tests for tracing enablement.

@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 telemetry tracing options to ClientOptions and integrates them into createApiCall to determine if tracing is enabled. Key feedback includes explicitly checking if the GOOGLE_SDK_NODE_EXPERIMENTAL_O11Y_ENABLED environment variable equals 'true' to avoid false positives with other string values. Additionally, the console.log statements used for debugging tracing status should be removed to prevent polluting the standard output of consuming applications, and the corresponding unit tests that spy on these logs should be cleaned up.

Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/test/unit/apiCallable.ts
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch 2 times, most recently from f45d91d to ae7b3a3 Compare August 19, 2026 23:56
@shivanee-p
shivanee-p marked this pull request as ready for review August 19, 2026 23:57
@shivanee-p
shivanee-p requested a review from a team as a code owner August 19, 2026 23:57

@westarle westarle 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.

I think we should consider CallSettings carefully. I would take the change to

Comment thread core/packages/gax/src/clientInterface.ts Outdated
Comment thread core/packages/gax/src/clientInterface.ts Outdated
Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/src/clientInterface.ts
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch 2 times, most recently from cef268a to 39ae92a Compare August 20, 2026 22:46
@shivanee-p
shivanee-p requested a review from westarle August 20, 2026 22:49
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch 4 times, most recently from 8baf444 to 32dc2d6 Compare August 24, 2026 16:41

@danieljbruce danieljbruce 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.

Do you have any more information about the CallSettings comment from Wes? Seems like it is okay to expose the options here, I just don't have enough context.

Comment thread core/packages/gax/src/clientInterface.ts Outdated
Comment thread core/packages/gax/src/createApiCall.ts Outdated
Comment thread core/packages/gax/src/clientInterface.ts
Comment thread core/packages/gax/src/clientInterface.ts Outdated

@westarle westarle 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.

everything else lgtm if you can get a review from the team.

@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch from 32dc2d6 to 93be23f Compare August 25, 2026 20:02
@shivanee-p

Copy link
Copy Markdown
Contributor Author

/gemini

@danieljbruce danieljbruce 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.

I don't know enough to know why merge and the gax constructor will need these new options yet, but supporting the new options only in CallSettings would be better if it is possible and if the user does not need them. Maybe we want to expose these options to the user though so I'll add a LGTM, but let's make sure there is no other choice.

Comment thread core/packages/gax/src/gax.ts Outdated
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch from aab773c to e8d848e Compare August 25, 2026 22:48
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch from e8d848e to cdd934f Compare August 25, 2026 22:50
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-options branch from 56b130f to bac5250 Compare August 25, 2026 22:56
@shivanee-p
shivanee-p dismissed westarle’s stale review August 25, 2026 22:59

Changes have been applied.

@shivanee-p shivanee-p added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 25, 2026
@shivanee-p
shivanee-p merged commit 257a895 into main Aug 25, 2026
44 checks passed
@shivanee-p
shivanee-p deleted the shivaneep-o11y-client-options branch August 25, 2026 23:12
@release-please release-please Bot mentioned this pull request Aug 25, 2026
danieljbruce pushed a commit that referenced this pull request Aug 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>common: 8.0.2</summary>

##
[8.0.2](common-v8.0.1...common-v8.0.2)
(2026-08-26)


### Bug Fixes

* Patch the vulnerability for Bigquery and other REST based clients
([#9188](#9188))
([94aac1e](94aac1e))
</details>

<details><summary>google-gax: 6.1.0</summary>

##
[6.1.0](google-gax-v6.0.3...google-gax-v6.1.0)
(2026-08-26)


### Features

* Add Otel Tracing helpers and tests
([#9070](#9070))
([5111d52](5111d52))
* **gax:** Accept clientOptions in createApiCall for telemetry tracing
([#9176](#9176))
([257a895](257a895))


### Bug Fixes

* **gax:** Fix several missing files from the monorepo merge
([#9209](#9209))
([6fcd94d](6fcd94d))
* Turn on the gax vulnerability tests again
([#9204](#9204))
([09609c8](09609c8))
</details>

<details><summary>bigquery: 9.0.3</summary>

##
[9.0.3](bigquery-v9.0.2...bigquery-v9.0.3)
(2026-08-26)


### Bug Fixes

* Patch the vulnerability for Bigquery and other REST based clients
([#9188](#9188))
([94aac1e](94aac1e))
</details>

<details><summary>health: 0.6.1</summary>

##
[0.6.1](health-v0.6.0...health-v0.6.1)
(2026-08-26)


### Bug Fixes

* Upgrade sinon types for health package
([#9202](#9202))
([b312515](b312515))
</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

Labels

kokoro:force-run Add this label to force Kokoro to re-run the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants