Skip to content

feat(gax): add observability logging flag - #9656

Merged
shivanee-p merged 5 commits into
mainfrom
shivaneep-o11y-logging-flag
Oct 23, 2026
Merged

shivanee-p merged 5 commits into
mainfrom
shivaneep-o11y-logging-flag

Conversation

@shivanee-p

@shivanee-p shivanee-p commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

This adds an enableTelemetryLogging client option to gax, alongside the existing enableTelemetryTracing. Logging is gated behind an existing node logging experimental env var, and the resolved tracing and logging flags are passed to each call through CallSettings.otherArgs

Key Changes

  • Renamed checkTelemetryEnabled to checkTracingEnabled to make room for a logging check. Updated the callers in createApiCall.ts and the export in index.ts
  • Added checkLoggingEnabled(settings?). Logging is enabled only when:
    • GOOGLE_SDK_NODE_EXPERIMENTAL_LOGGING is true/1, and
    • either GOOGLE_SDK_NODE_LOGGING is true/1, or, if that env var is unset, enableTelemetryLogging: true is set on the settings or on otherArgs.
    • GOOGLE_SDK_NODE_LOGGING always overrides the client option when it is set.
  • Added enableTelemetryLogging?: boolean to ClientOptions, GrpcClientOptions, CallOptions and CallSettings
  • When tracing or logging is requested, otherArgs now includes internalMethodName, enableTelemetryTracing and enableTelemetryLogging

@shivanee-p

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 introduces telemetry logging capabilities to the Google API Extensions (gax) library, controlled by the GOOGLE_SDK_NODE_EXPERIMENTAL_LOGGING and GOOGLE_SDK_NODE_ENABLE_LOGGING environment variables or the enableTelemetryLogging client option. It also renames existing tracing-related telemetry functions to distinguish them from the new logging features. Feedback on the changes highlights a critical issue in gax.ts where the parameter-shifting logic in constructSettings was not updated to handle the new enableTelemetryLogging and _legacyTelemetryInfo parameters when status is omitted, which will cause incorrect parameter mapping and test failures.

Comment thread core/packages/gax/src/gax.ts Resolved
Comment thread core/packages/gax/test/unit/gax.ts Resolved

@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 logging capabilities to the GAX client, adding enableTelemetryLogging configuration options across client options, call settings, and environment variables. However, critical parameter mismatches were identified in both fallback.ts and grpc.ts when calling the imported constructSettings function. Because the apiName parameter was omitted, subsequent arguments like enableTelemetryTracing and enableTelemetryLogging are misaligned and mapped incorrectly.

Comment thread core/packages/gax/src/fallback.ts Resolved
Comment thread core/packages/gax/src/grpc.ts Resolved
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-logging-flag branch from 36a8e1d to 5ee484f Compare October 19, 2026 21:39
@shivanee-p shivanee-p changed the title chore(gax): add observability logging flag feat(gax): add observability logging flag Oct 19, 2026
@shivanee-p
shivanee-p marked this pull request as ready for review October 19, 2026 22:05
@shivanee-p
shivanee-p requested a review from a team as a code owner October 19, 2026 22:05
@shivanee-p

Copy link
Copy Markdown
Contributor Author

Note: the error from the breaking-change-check is a false positive and not related to the changes in this PR

@shivanee-p shivanee-p added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 19, 2026
@github-actions
github-actions Bot requested a review from danieljbruce October 19, 2026 22:25
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-logging-flag branch from 5ee484f to 1c09131 Compare October 21, 2026 23:04
@shivanee-p shivanee-p removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 21, 2026
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-logging-flag branch from 1c09131 to 144d435 Compare October 21, 2026 23:07

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

Overall looks good :)

Comment thread core/packages/gax/src/gax.ts Resolved
@shivanee-p
shivanee-p merged commit c0ab589 into main Oct 23, 2026
46 checks passed
@shivanee-p
shivanee-p deleted the shivaneep-o11y-logging-flag branch October 23, 2026 20:17
@release-please release-please Bot mentioned this pull request Oct 23, 2026
danieljbruce pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>gapic-generator: 5.7.3</summary>

##
[5.7.3](gapic-generator-v5.7.2...gapic-generator-v5.7.3)
(2026-10-28)


### Bug Fixes

* **core:** Log request/response payloads at DEBUG severity
([#9754](#9754))
([bf46818](bf46818))
</details>

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

##
[6.14.0](google-gax-v6.13.0...google-gax-v6.14.0)
(2026-10-28)


### Features

* **gax:** Add observability logging flag
([#9656](#9656))
([c0ab589](c0ab589))


### Bug Fixes

* **gax:** Suppress cancel destroy error in StreamArrayParser and add
Bun certification matrix
([#9652](#9652))
([a802909](a802909))
</details>

<details><summary>gcp-metadata: 9.2.3</summary>

##
[9.2.3](gcp-metadata-v9.2.2...gcp-metadata-v9.2.3)
(2026-10-28)


### Bug Fixes

* **core:** Log request/response payloads at DEBUG severity
([#9754](#9754))
([bf46818](bf46818))
</details>

<details><summary>google-auth-library: 11.3.2</summary>

##
[11.3.2](google-auth-library-v11.3.1...google-auth-library-v11.3.2)
(2026-10-28)


### Bug Fixes

* **core:** Log request/response payloads at DEBUG severity
([#9754](#9754))
([bf46818](bf46818))
* **google-auth-library:** Add credential deprecation and validation
warnings
([#9720](#9720))
([569678a](569678a))
</details>

<details><summary>google-logging-utils: 2.1.1</summary>

##
[2.1.1](google-logging-utils-v2.1.0...google-logging-utils-v2.1.1)
(2026-10-28)


### Bug Fixes

* **core:** Log request/response payloads at DEBUG severity
([#9754](#9754))
([bf46818](bf46818))
* **logging-utils:** Export LogSeverity as value and treat 'true' as '*'
alias
([#9718](#9718))
([e8da4f0](e8da4f0))
</details>

<details><summary>gapic-tools: 2.2.1</summary>

##
[2.2.1](gapic-tools-v2.2.0...gapic-tools-v2.2.1)
(2026-10-28)


### Bug Fixes

* **gapic-tools:** Strip JS method bodies before pbts and parallelize
minification
([#9737](#9737))
([c7884b8](c7884b8))
</details>

<details><summary>test-utils: 0.4.0</summary>

##
[0.4.0](test-utils-v0.3.1...test-utils-v0.4.0)
(2026-10-28)


### Features

* **test-utils:** Add createProxyquire and proxyquire helper
([#9759](#9759))
([763d1bd](763d1bd))
</details>

<details><summary>bigtable: 7.5.1</summary>

##
[7.5.1](bigtable-v7.5.0...bigtable-v7.5.1)
(2026-10-28)


### Bug Fixes

* **bigtable:** Use ReadonlyMap for EncodedKeyMap implements clause
([#9709](#9709))
([f803bff](f803bff))
</details>

<details><summary>pubsub: 6.3.2</summary>

##
[6.3.2](pubsub-v6.3.1...pubsub-v6.3.2)
(2026-10-28)


### Bug Fixes

* **pubsub:** Reuse GoogleAuth instance and deprecate credential options
([#9721](#9721))
([4c4ba34](4c4ba34))
</details>

<details><summary>datamanager: 1.5.0</summary>

##
[1.5.0](datamanager-v1.4.0...datamanager-v1.5.0)
(2026-10-28)


### Features

* **datamanager:** Update release_level to stable in .repo-metadata.json
([#9725](#9725))
([6eb9340](6eb9340)),
refs
[#9685](#9685)
</details>

<details><summary>observability: 0.1.0</summary>

## 0.1.0 (2026-10-28)


### Features

* **google/cloud/observability/v1:** Onboard a new library
([#9689](#9689))
([5e53e2e](5e53e2e))
</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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants