Skip to content

feat(o11y): let callers enable tracing with env var - #9377

Open
shivanee-p wants to merge 1 commit into
mainfrom
shivaneep-o11y-client-enabling
Open

shivanee-p wants to merge 1 commit into
mainfrom
shivaneep-o11y-client-enabling

Conversation

@shivanee-p

Copy link
Copy Markdown
Contributor

Tracing could only be switched on from code, by passing enableTelemetryTracing in clientOptions, so collecting traces meant editing and redeploying the application.

Read GOOGLE_SDK_NODE_ENABLE_TRACING in checkTelemetryEnabled and let it win over the client option whenever it is set, so tracing can be turned on or off per process. An absent or empty value leaves the client option in charge, and GOOGLE_SDK_NODE_EXPERIMENTAL_O11Y_ENABLED is still required while the feature is experimental.

@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 support for the GOOGLE_SDK_NODE_ENABLE_TRACING environment variable, allowing users to globally enable or disable telemetry tracing. This environment variable overrides the enableTelemetryTracing client option. The changes include updates to the generator templates, client interface documentation, utility functions, and unit tests. Feedback suggests checking if process is defined before accessing process.env to prevent potential ReferenceError exceptions in non-Node environments like browsers or edge runtimes.

Comment thread core/packages/gax/src/util.ts Outdated
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-enabling branch 2 times, most recently from 1241b27 to a7dace8 Compare September 18, 2026 18:27
…ACING

Tracing could only be switched on from code, by passing
enableTelemetryTracing in clientOptions, so collecting traces meant
editing and redeploying the application.

Read GOOGLE_SDK_NODE_ENABLE_TRACING in checkTelemetryEnabled and let it
win over the client option whenever it is set, so tracing can be turned
on or off per process. An absent or empty value leaves the client option
in charge, and GOOGLE_SDK_NODE_EXPERIMENTAL_O11Y_ENABLED is still
required while the feature is experimental.
@shivanee-p
shivanee-p force-pushed the shivaneep-o11y-client-enabling branch from a7dace8 to 7eae8b8 Compare September 18, 2026 20:51
@shivanee-p
shivanee-p marked this pull request as ready for review September 18, 2026 20:51
@shivanee-p
shivanee-p requested a review from a team as a code owner September 18, 2026 20:51
@github-actions
github-actions Bot requested a review from feywind September 18, 2026 20:51
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.

1 participant