Skip to content

refactor(gax): organize observability utilities into util, contextUtil, and errorUtil - #9590

Merged
shivanee-p merged 2 commits into
mainfrom
shivaneep-o11y-util-organization
Oct 9, 2026
Merged

shivanee-p merged 2 commits into
mainfrom
shivaneep-o11y-util-organization

Conversation

@shivanee-p

Copy link
Copy Markdown
Contributor

Reorganizes the OpenTelemetry tracing helpers in google-gax (core/packages/gax/src/observability/) into focused utility modules and aligns the unit test suite accordingly.

Fixes:

  • Extracted general observability helpers into observability/util.ts
  • Consolidated trace context interfaces and active client-request/attempt context propagation into observability/contextUtil.ts
  • Extracted error classification constants and error/exception helpers into observability/errorUtil.ts
  • Split and deduplicated unit tests without redundant overlapping assertions

@shivanee-p
shivanee-p marked this pull request as ready for review October 9, 2026 17:37
@shivanee-p
shivanee-p requested a review from a team as a code owner October 9, 2026 17:37
@github-actions
github-actions Bot requested a review from danieljbruce October 9, 2026 17:37

@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 refactors the observability module in google-gax by extracting error handling, telemetry checking, and trace context utilities from TracerHelper.ts and util.ts into dedicated files: errorUtil.ts, contextUtil.ts, and observability/util.ts. Corresponding test files have been updated and expanded. Feedback on the changes suggests ensuring that detail.errorInfo.reason is validated as a non-empty string before returning it in resolveErrorInfoReason to prevent empty error.type attributes in telemetry.

Comment thread core/packages/gax/src/observability/errorUtil.ts
@shivanee-p
shivanee-p merged commit 62806da into main Oct 9, 2026
46 checks passed
@shivanee-p
shivanee-p deleted the shivaneep-o11y-util-organization branch October 9, 2026 18:49
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