/** * When a trace leaves the process, it needs to be propagated, usually via headers. This utility * is used to inject or extract a trace context from remote requests. */ // Implementations should override and cache this as a field. public Propagation<String> propagation() { return propagationFactory().create(Propagation.KeyFactory.STRING); }
GrpcTracing(Builder builder) { // intentionally hidden constructor tracing = builder.tracing; grpcPropagationFormatEnabled = builder.grpcPropagationFormatEnabled; Propagation.Factory propagationFactory = tracing.propagationFactory(); if (grpcPropagationFormatEnabled) { propagationFactory = GrpcPropagation.newFactory(propagationFactory); } propagation = propagationFactory.create(AsciiMetadataKeyFactory.INSTANCE); clientParser = builder.clientParser; serverParser = builder.serverParser; }
/** * Creates a new instance. */ protected HttpTracingClient(Client<HttpRequest, HttpResponse> delegate, Tracing tracing, @Nullable String remoteServiceName) { super(delegate); tracer = tracing.tracer(); injector = tracing.propagationFactory().create(AsciiStringKeyFactory.INSTANCE) .injector(HttpHeaders::set); this.remoteServiceName = remoteServiceName; }
/** * Creates a new instance. */ public HttpTracingService(Service<HttpRequest, HttpResponse> delegate, Tracing tracing) { super(delegate); tracer = tracing.tracer(); extractor = tracing.propagationFactory().create(AsciiStringKeyFactory.INSTANCE) .extractor(HttpHeaders::get); }
/** * When a trace leaves the process, it needs to be propagated, usually via headers. This utility * is used to inject or extract a trace context from remote requests. */ // Implementations should override and cache this as a field. public Propagation<String> propagation() { return propagationFactory().create(Propagation.KeyFactory.STRING); }
GrpcTracing(Builder builder) { // intentionally hidden constructor tracing = builder.tracing; grpcPropagationFormatEnabled = builder.grpcPropagationFormatEnabled; Propagation.Factory propagationFactory = tracing.propagationFactory(); if (grpcPropagationFormatEnabled) { propagationFactory = GrpcPropagation.newFactory(propagationFactory); } propagation = propagationFactory.create(AsciiMetadataKeyFactory.INSTANCE); clientParser = builder.clientParser; serverParser = builder.serverParser; }