From 8d6ff4c9b4c2fe42bcb71ae694fbe697511a2a6a Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Fri, 18 Aug 2017 17:19:52 -0700 Subject: [PATCH] core: enable Census trace context propagation. (#3361) Note a Census tracing implementation, which is not included in gRPC, is still required for tracing to work. --- .../AbstractManagedChannelImplBuilder.java | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java index 1c4cdc9227..ad41668a07 100644 --- a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java +++ b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java @@ -119,8 +119,6 @@ public abstract class AbstractManagedChannelImplBuilder private int maxInboundMessageSize = GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; - private boolean enableTracing; - /** * Sets the maximum message size allowed for a single gRPC frame. If an inbound messages * larger than this limit is received it will not be processed and the RPC will fail with @@ -299,15 +297,6 @@ public abstract class AbstractManagedChannelImplBuilder return GrpcUtil.checkAuthority(authority); } - /** - * Set it to true to record traces and propagate tracing information on the wire. This will be - * deleted assuming always enabled once the instrumentation-java wire format is stabilized. - */ - @Deprecated - public void setEnableTracing(boolean enabled) { - this.enableTracing = enabled; - } - @Override public ManagedChannel build() { return new ManagedChannelImpl( @@ -334,12 +323,10 @@ public abstract class AbstractManagedChannelImplBuilder effectiveInterceptors.add(0, censusStats.getClientInterceptor()); } } - if (enableTracing) { - CensusTracingModule censusTracing = - new CensusTracingModule(Tracing.getTracer(), - Tracing.getPropagationComponent().getBinaryFormat()); - effectiveInterceptors.add(0, censusTracing.getClientInterceptor()); - } + CensusTracingModule censusTracing = + new CensusTracingModule(Tracing.getTracer(), + Tracing.getPropagationComponent().getBinaryFormat()); + effectiveInterceptors.add(0, censusTracing.getClientInterceptor()); return effectiveInterceptors; }