Skip to content

fix(gax): Implement lazy resource name evaluation in ApiTracerContext#12618

Merged
blakeli0 merged 2 commits intomainfrom
lazy-resource-name-extraction
Apr 2, 2026
Merged

fix(gax): Implement lazy resource name evaluation in ApiTracerContext#12618
blakeli0 merged 2 commits intomainfrom
lazy-resource-name-extraction

Conversation

@blakeli0
Copy link
Copy Markdown
Contributor

@blakeli0 blakeli0 commented Apr 2, 2026

This PR

  • Move the resource name extraction logic from TracedUnaryCallable to ApiTracerContext. This ensures that the extraction is done lazily only when resource name is needed in tracing. Hence it does not affect regular customers at all if tracing is not enabled.
  • Prepends urlDomain to resource name.

@blakeli0 blakeli0 requested a review from a team as a code owner April 2, 2026 03:21
@blakeli0 blakeli0 requested a review from diegomarquezp April 2, 2026 03:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 destination resource ID handling in ApiTracerContext to support lazy evaluation via a Supplier, which improves performance and flexibility. The changes include updating the Builder API and migrating existing usages to the new supplier-based approach. I have provided a suggestion to maintain backward compatibility by keeping the original setDestinationResourceId method as a convenience wrapper. The second review comment was removed as it was a general observation without an actionable code suggestion.

@blakeli0 blakeli0 changed the title fix: Implement lazy resource name evaluation in ApiTracerContext fix(gax): Implement lazy resource name evaluation in ApiTracerContext Apr 2, 2026
@blakeli0 blakeli0 merged commit 5e47749 into main Apr 2, 2026
123 of 124 checks passed
@blakeli0 blakeli0 deleted the lazy-resource-name-extraction branch April 2, 2026 15:50
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