Refactor gRPC library instrumentation to expose minimal API.
MODIFY
instrumentation/grpc-1.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_5/GrpcClientBuilderBuildInstrumentation.java
instrumentation/grpc-1.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_5/GrpcClientBuilderBuildInstrumentation.java
@@ -13,7 +13,6 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
import io.grpc.ClientInterceptor;
-import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.List;
import java.util.Map;
@@ -46,16 +45,7 @@ public class GrpcClientBuilderBuildInstrumentation implements TypeInstrumentatio
@Advice.OnMethodEnter(suppress = Throwable.class)
public static void addInterceptor(
@Advice.FieldValue("interceptors") List<ClientInterceptor> interceptors) {
- boolean shouldRegister = true;
- for (ClientInterceptor interceptor : interceptors) {
- if (interceptor instanceof TracingClientInterceptor) {
- shouldRegister = false;
- break;
- }
- }
- if (shouldRegister) {
- interceptors.add(0, TracingClientInterceptor.newInterceptor());
- }
+ interceptors.add(0, GrpcInterceptors.CLIENT_INTERCEPTOR);
}
}
}

ADD
instrumentation/grpc-1.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_5/GrpcInterceptors.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.grpc.v1_5;
+
+import io.grpc.ClientInterceptor;
+import io.grpc.ServerInterceptor;
+import io.opentelemetry.api.GlobalOpenTelemetry;
+import io.opentelemetry.instrumentation.api.config.Config;
+import io.opentelemetry.instrumentation.grpc.v1_5.GrpcTracing;
+
+// Holds singleton references to tracers.
+public final class GrpcInterceptors {
+ private static final GrpcTracing TRACING =
+ GrpcTracing.newBuilder(GlobalOpenTelemetry.get())
+ .setCaptureExperimentalSpanAttributes(
+ Config.get()
+ .getBooleanProperty(
+ "otel.instrumentation.grpc.experimental-span-attributes", false))
+ .build();
+
+ public static final ClientInterceptor CLIENT_INTERCEPTOR = TRACING.newClientInterceptor();
+
+ public static final ServerInterceptor SERVER_INTERCEPTOR = TRACING.newServerInterceptor();
+}

MODIFY
instrumentation/grpc-1.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_5/GrpcServerBuilderInstrumentation.java
instrumentation/grpc-1.5/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_5/GrpcServerBuilderInstrumentation.java
@@ -13,7 +13,6 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import io.grpc.ServerBuilder;
-import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor;
import io.opentelemetry.javaagent.instrumentation.api.CallDepthThreadLocalMap;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Collections;
@@ -48,7 +47,7 @@ public class GrpcServerBuilderInstrumentation implements TypeInstrumentation {
public static void onEnter(@Advice.This ServerBuilder<?> serverBuilder) {
int callDepth = CallDepthThreadLocalMap.incrementCallDepth(ServerBuilder.class);
if (callDepth == 0) {
- serverBuilder.intercept(TracingServerInterceptor.newInterceptor());
+ serverBuilder.intercept(GrpcInterceptors.SERVER_INTERCEPTOR);
}
}

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcClientTracer.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.client;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import static io.opentelemetry.api.trace.SpanKind.CLIENT;
import io.grpc.Status;
+import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Context;
import io.opentelemetry.instrumentation.api.tracer.RpcClientTracer;
-import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
-public class GrpcClientTracer extends RpcClientTracer {
+final class GrpcClientTracer extends RpcClientTracer {
- protected GrpcClientTracer() {}
-
- protected GrpcClientTracer(Tracer tracer) {
- super(tracer);
+ GrpcClientTracer(OpenTelemetry openTelemetry) {
+ super(openTelemetry);
}
@Override

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcExtractAdapter.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcExtractAdapter.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.server;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import io.grpc.Metadata;
import io.opentelemetry.context.propagation.TextMapGetter;

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelper.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcHelper.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.common;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import io.grpc.Status.Code;
import io.opentelemetry.api.common.AttributeKey;
@@ -11,7 +11,7 @@ import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.StatusCode;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
-public final class GrpcHelper {
+final class GrpcHelper {
public static final AttributeKey<String> MESSAGE_TYPE = AttributeKey.stringKey("message.type");
public static final AttributeKey<Long> MESSAGE_ID = AttributeKey.longKey("message.id");

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcInjectAdapter.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcInjectAdapter.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.client;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import io.grpc.Metadata;
import io.opentelemetry.context.propagation.TextMapSetter;

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcServerTracer.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.server;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import static io.opentelemetry.api.trace.SpanKind.SERVER;
import io.grpc.Metadata;
import io.grpc.Status;
+import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.SpanBuilder;
-import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.propagation.TextMapGetter;
import io.opentelemetry.instrumentation.api.tracer.RpcServerTracer;
-import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
-public class GrpcServerTracer extends RpcServerTracer<Metadata> {
+final class GrpcServerTracer extends RpcServerTracer<Metadata> {
- GrpcServerTracer() {}
-
- GrpcServerTracer(Tracer tracer) {
- super(tracer);
+ GrpcServerTracer(OpenTelemetry openTelemetry) {
+ super(openTelemetry);
}
public Context startSpan(String name, Metadata headers) {

ADD
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTracing.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.instrumentation.grpc.v1_5;
+
+import io.grpc.ClientInterceptor;
+import io.grpc.ServerInterceptor;
+import io.opentelemetry.api.OpenTelemetry;
+
+/** Entrypoint for tracing gRPC servers or clients. */
+public final class GrpcTracing {
+
+ /** Returns a new {@link GrpcTracing} configured with the given {@link OpenTelemetry}. */
+ public static GrpcTracing create(OpenTelemetry openTelemetry) {
+ return newBuilder(openTelemetry).build();
+ }
+
+ /** Returns a new {@link GrpcTracingBuilder} configured with the given {@link OpenTelemetry}. */
+ public static GrpcTracingBuilder newBuilder(OpenTelemetry openTelemetry) {
+ return new GrpcTracingBuilder(openTelemetry);
+ }
+
+ private final boolean captureExperimentalSpanAttributes;
+
+ private final GrpcClientTracer clientTracer;
+ private final GrpcServerTracer serverTracer;
+
+ GrpcTracing(OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes) {
+ this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes;
+ clientTracer = new GrpcClientTracer(openTelemetry);
+ serverTracer = new GrpcServerTracer(openTelemetry);
+ }
+
+ /**
+ * Returns a new {@link TracingClientInterceptor} for use with methods like {@link
+ * io.grpc.ManagedChannelBuilder#intercept(ClientInterceptor...)}.
+ */
+ public TracingClientInterceptor newClientInterceptor() {
+ return new TracingClientInterceptor(clientTracer);
+ }
+
+ /**
+ * Returns a new {@link TracingServerInterceptor} for use with methods like {@link
+ * io.grpc.ServerBuilder#intercept(ServerInterceptor)}.
+ */
+ public TracingServerInterceptor newServerInterceptor() {
+ return new TracingServerInterceptor(serverTracer, captureExperimentalSpanAttributes);
+ }
+}

ADD
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTracingBuilder.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.instrumentation.grpc.v1_5;
+
+import io.opentelemetry.api.OpenTelemetry;
+
+/** A builder of {@link GrpcTracing}. */
+public final class GrpcTracingBuilder {
+
+ private final OpenTelemetry openTelemetry;
+
+ private boolean captureExperimentalSpanAttributes;
+
+ GrpcTracingBuilder(OpenTelemetry openTelemetry) {
+ this.openTelemetry = openTelemetry;
+ }
+
+ /**
+ * Sets whether experimental attributes should be set to spans. These attributes may be changed or
+ * removed in the future, so only enable this if you know you do not require attributes filled by
+ * this instrumentation to be stable across versions
+ */
+ public GrpcTracingBuilder setCaptureExperimentalSpanAttributes(
+ boolean captureExperimentalSpanAttributes) {
+ this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes;
+ return this;
+ }
+
+ /** Returns a new {@link GrpcTracing} with the settings of this {@link GrpcTracingBuilder}. */
+ public GrpcTracing build() {
+ return new GrpcTracing(openTelemetry, captureExperimentalSpanAttributes);
+ }
+}

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/TracingClientInterceptor.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.client;
+package io.opentelemetry.instrumentation.grpc.v1_5;
-import static io.opentelemetry.instrumentation.grpc.v1_5.client.GrpcInjectAdapter.SETTER;
+import static io.opentelemetry.instrumentation.grpc.v1_5.GrpcInjectAdapter.SETTER;
import io.grpc.CallOptions;
import io.grpc.Channel;
@@ -20,32 +20,18 @@ import io.grpc.MethodDescriptor;
import io.grpc.Status;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils;
-import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.atomic.AtomicLong;
-public class TracingClientInterceptor implements ClientInterceptor {
-
- public static ClientInterceptor newInterceptor() {
- return newInterceptor(new GrpcClientTracer());
- }
-
- public static ClientInterceptor newInterceptor(Tracer tracer) {
- return newInterceptor(new GrpcClientTracer(tracer));
- }
-
- public static ClientInterceptor newInterceptor(GrpcClientTracer tracer) {
- return new TracingClientInterceptor(tracer);
- }
+final class TracingClientInterceptor implements ClientInterceptor {
private final GrpcClientTracer tracer;
- private TracingClientInterceptor(GrpcClientTracer tracer) {
+ TracingClientInterceptor(GrpcClientTracer tracer) {
this.tracer = tracer;
}
@@ -73,32 +59,26 @@ public class TracingClientInterceptor implements ClientInterceptor {
NetPeerUtils.INSTANCE.setNetPeer(span, inetSocketAddress);
}
- return new TracingClientCall<>(result, span, context, tracer);
+ return new TracingClientCall<>(result, span, context);
}
- static final class TracingClientCall<REQUEST, RESPONSE>
+ final class TracingClientCall<REQUEST, RESPONSE>
extends ForwardingClientCall.SimpleForwardingClientCall<REQUEST, RESPONSE> {
private final Span span;
private final Context context;
- private final GrpcClientTracer tracer;
- TracingClientCall(
- ClientCall<REQUEST, RESPONSE> delegate,
- Span span,
- Context context,
- GrpcClientTracer tracer) {
+ TracingClientCall(ClientCall<REQUEST, RESPONSE> delegate, Span span, Context context) {
super(delegate);
this.span = span;
this.context = context;
- this.tracer = tracer;
}
@Override
public void start(Listener<RESPONSE> responseListener, Metadata headers) {
tracer.inject(context, headers, SETTER);
try (Scope ignored = context.makeCurrent()) {
- super.start(new TracingClientCallListener<>(responseListener, context, tracer), headers);
+ super.start(new TracingClientCallListener<>(responseListener, context), headers);
} catch (Throwable e) {
tracer.endExceptionally(context, e);
throw e;
@@ -116,18 +96,15 @@ public class TracingClientInterceptor implements ClientInterceptor {
}
}
- static final class TracingClientCallListener<RESPONSE>
+ final class TracingClientCallListener<RESPONSE>
extends ForwardingClientCallListener.SimpleForwardingClientCallListener<RESPONSE> {
private final Context context;
- private final GrpcClientTracer tracer;
private final AtomicLong messageId = new AtomicLong();
- TracingClientCallListener(
- Listener<RESPONSE> delegate, Context context, GrpcClientTracer tracer) {
+ TracingClientCallListener(Listener<RESPONSE> delegate, Context context) {
super(delegate);
this.context = context;
- this.tracer = tracer;
}
@Override

RENAME
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/TracingServerInterceptor.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.server;
+package io.opentelemetry.instrumentation.grpc.v1_5;
import io.grpc.ForwardingServerCall;
import io.grpc.ForwardingServerCallListener;
@@ -16,38 +16,21 @@ import io.grpc.ServerInterceptor;
import io.grpc.Status;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
-import io.opentelemetry.instrumentation.api.config.Config;
-import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.atomic.AtomicLong;
-public class TracingServerInterceptor implements ServerInterceptor {
-
- private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES =
- Config.get()
- .getBooleanProperty("otel.instrumentation.grpc.experimental-span-attributes", false);
-
- public static ServerInterceptor newInterceptor() {
- return newInterceptor(new GrpcServerTracer());
- }
-
- public static ServerInterceptor newInterceptor(Tracer tracer) {
- return newInterceptor(new GrpcServerTracer(tracer));
- }
-
- public static ServerInterceptor newInterceptor(GrpcServerTracer tracer) {
- return new TracingServerInterceptor(tracer);
- }
+final class TracingServerInterceptor implements ServerInterceptor {
private final GrpcServerTracer tracer;
+ private final boolean captureExperimentalSpanAttributes;
- private TracingServerInterceptor(GrpcServerTracer tracer) {
+ TracingServerInterceptor(GrpcServerTracer tracer, boolean captureExperimentalSpanAttributes) {
this.tracer = tracer;
+ this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes;
}
@Override
@@ -71,23 +54,20 @@ public class TracingServerInterceptor implements ServerInterceptor {
try (Scope ignored = context.makeCurrent()) {
return new TracingServerCallListener<>(
- next.startCall(new TracingServerCall<>(call, context, tracer), headers), context, tracer);
+ next.startCall(new TracingServerCall<>(call, context), headers), context);
} catch (Throwable e) {
tracer.endExceptionally(context, e);
throw e;
}
}
- static final class TracingServerCall<REQUEST, RESPONSE>
+ final class TracingServerCall<REQUEST, RESPONSE>
extends ForwardingServerCall.SimpleForwardingServerCall<REQUEST, RESPONSE> {
private final Context context;
- private final GrpcServerTracer tracer;
- TracingServerCall(
- ServerCall<REQUEST, RESPONSE> delegate, Context context, GrpcServerTracer tracer) {
+ TracingServerCall(ServerCall<REQUEST, RESPONSE> delegate, Context context) {
super(delegate);
this.context = context;
- this.tracer = tracer;
}
@Override
@@ -102,18 +82,15 @@ public class TracingServerInterceptor implements ServerInterceptor {
}
}
- static final class TracingServerCallListener<REQUEST>
+ final class TracingServerCallListener<REQUEST>
extends ForwardingServerCallListener.SimpleForwardingServerCallListener<REQUEST> {
private final Context context;
- private final GrpcServerTracer tracer;
private final AtomicLong messageId = new AtomicLong();
- TracingServerCallListener(
- Listener<REQUEST> delegate, Context context, GrpcServerTracer tracer) {
+ TracingServerCallListener(Listener<REQUEST> delegate, Context context) {
super(delegate);
this.context = context;
- this.tracer = tracer;
}
@Override
@@ -145,7 +122,7 @@ public class TracingServerInterceptor implements ServerInterceptor {
public void onCancel() {
try (Scope ignored = context.makeCurrent()) {
delegate().onCancel();
- if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
+ if (captureExperimentalSpanAttributes) {
Span.fromContext(context).setAttribute("grpc.canceled", true);
}
} catch (Throwable e) {

RENAME
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/common/GrpcHelperTest.groovy
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcHelperTest.groovy
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.grpc.v1_5.common
+package io.opentelemetry.instrumentation.grpc.v1_5
import io.grpc.Status
import io.opentelemetry.api.trace.StatusCode

MODIFY
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcStreamingTest.groovy
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcStreamingTest.groovy
@@ -7,18 +7,16 @@ package io.opentelemetry.instrumentation.grpc.v1_5
import io.grpc.ManagedChannelBuilder
import io.grpc.ServerBuilder
-import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor
-import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor
import io.opentelemetry.instrumentation.test.LibraryTestTrait
class GrpcStreamingTest extends AbstractGrpcStreamingTest implements LibraryTestTrait {
@Override
ServerBuilder configureServer(ServerBuilder server) {
- return server.intercept(TracingServerInterceptor.newInterceptor())
+ return server.intercept(GrpcTracing.create(getOpenTelemetry()).newServerInterceptor())
}
@Override
ManagedChannelBuilder configureClient(ManagedChannelBuilder client) {
- return client.intercept(TracingClientInterceptor.newInterceptor())
+ return client.intercept(GrpcTracing.create(getOpenTelemetry()).newClientInterceptor())
}
}

MODIFY
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTest.groovy
instrumentation/grpc-1.5/library/src/test/groovy/io/opentelemetry/instrumentation/grpc/v1_5/GrpcTest.groovy
@@ -7,18 +7,16 @@ package io.opentelemetry.instrumentation.grpc.v1_5
import io.grpc.ManagedChannelBuilder
import io.grpc.ServerBuilder
-import io.opentelemetry.instrumentation.grpc.v1_5.client.TracingClientInterceptor
-import io.opentelemetry.instrumentation.grpc.v1_5.server.TracingServerInterceptor
import io.opentelemetry.instrumentation.test.LibraryTestTrait
class GrpcTest extends AbstractGrpcTest implements LibraryTestTrait {
@Override
ServerBuilder configureServer(ServerBuilder server) {
- return server.intercept(TracingServerInterceptor.newInterceptor())
+ return server.intercept(GrpcTracing.create(getOpenTelemetry()).newServerInterceptor())
}
@Override
ManagedChannelBuilder configureClient(ManagedChannelBuilder client) {
- return client.intercept(TracingClientInterceptor.newInterceptor())
+ return client.intercept(GrpcTracing.create(getOpenTelemetry()).newClientInterceptor())
}
}

Refactor gRPC library instrumentation to expose minimal API. (#2474)