Skip to content

Commit 0bf950a

Browse files
committed
impl(o11y): address review comment about call options
1 parent 186bb85 commit 0bf950a

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,10 @@ public ApiTracer getTracer() {
608608
public HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer) {
609609
Preconditions.checkNotNull(newTracer);
610610

611+
HttpJsonCallOptions newOptions = callOptions.toBuilder().setTracer(newTracer).build();
611612
return new HttpJsonCallContext(
612613
this.channel,
613-
this.callOptions,
614+
newOptions,
614615
this.timeout,
615616
this.streamWaitTimeout,
616617
this.streamIdleTimeout,

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCalls.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ public static <RequestT, ResponseT> HttpJsonClientCall<RequestT, ResponseT> newC
7777
httpJsonContext.validateUniverseDomain();
7878

7979
HttpJsonCallOptions callOptions = httpJsonContext.getCallOptions();
80-
if (httpJsonContext.getTracer() != null) {
81-
callOptions = callOptions.toBuilder().setTracer(httpJsonContext.getTracer()).build();
82-
}
8380

8481
// TODO: add headers interceptor logic
8582
return httpJsonContext.getChannel().newCall(methodDescriptor, callOptions);

sdk-platform-java/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ void setUp() throws IOException {
9393
@Test
9494
void testValidUniverseDomain() {
9595
HttpJsonClientCalls.newCall(descriptor, callContext);
96-
HttpJsonCallOptions expectedCallOptions =
97-
callOptions.toBuilder().setTracer(callContext.getTracer()).build();
98-
Mockito.verify(mockChannel, Mockito.times(1)).newCall(descriptor, expectedCallOptions);
96+
Mockito.verify(mockChannel, Mockito.times(1)).newCall(descriptor, callOptions);
9997
}
10098

10199
// This test is when the universe domain does not match

0 commit comments

Comments
 (0)