refactor: remove the usages of SpanName constructor of TracedUnaryCallable#12948
refactor: remove the usages of SpanName constructor of TracedUnaryCallable#12948
Conversation
There was a problem hiding this comment.
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.
|
|
||
|
|
||
| public TracedUnaryCallable( |
There was a problem hiding this comment.
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);
}Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
|


This PR removes the usages of SpanName constructor of TracedUnaryCallable, and migrates all usages to use ApiTracerContext instead.
The constructor is now marked as
@ObsoleteApiand it should be removed once the usages in downstream libraries (java-bigtable) are removed.