Skip to content

refactor: remove the usages of SpanName constructor of TracedUnaryCallable#12948

Open
blakeli0 wants to merge 7 commits intomainfrom
remove-span-name-constructor
Open

refactor: remove the usages of SpanName constructor of TracedUnaryCallable#12948
blakeli0 wants to merge 7 commits intomainfrom
remove-span-name-constructor

Conversation

@blakeli0
Copy link
Copy Markdown
Contributor

@blakeli0 blakeli0 commented Apr 29, 2026

This PR removes the usages of SpanName constructor of TracedUnaryCallable, and migrates all usages to use ApiTracerContext instead.

The constructor is now marked as @ObsoleteApi and it should be removed once the usages in downstream libraries (java-bigtable) are removed.

@blakeli0 blakeli0 requested a review from a team as a code owner April 29, 2026 02:48
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 tracing logic to make ApiTracerContext mandatory for TracedUnaryCallable and TracedOperationInitialCallable, replacing the previous reliance on SpanName. The changes simplify the futureCall method and update associated tests to align with the new context-based tracing. Feedback suggests further cleanup by removing the now-unused spanName field and SPAN_NAME constants, and recommends adding a convenience constructor to TracedUnaryCallable to avoid passing explicit nulls for the resource name extractor.

Comment on lines 57 to 59


public TracedUnaryCallable(
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.

medium

Consider adding a 3-argument constructor for TracedUnaryCallable that omits the ResourceNameExtractor. This would simplify usage in cases where an extractor is not needed, such as in TracedOperationInitialCallable and various test cases.

  public TracedUnaryCallable(
      UnaryCallable<RequestT, ResponseT> innerCallable,
      ApiTracerFactory tracerFactory,
      ApiTracerContext apiTracerContext) {
    this(innerCallable, tracerFactory, apiTracerContext, null);
  }

@blakeli0 blakeli0 changed the title refactor: remove SpanName constructor from TracedUnaryCallable refactor: remove the usages of SpanName constructor of TracedUnaryCallable Apr 29, 2026
blakeli0 and others added 3 commits April 28, 2026 23:03
@blakeli0 blakeli0 requested a review from diegomarquezp April 29, 2026 22:12
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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