/** * 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; }
this.errorParser = builder.errorParser; this.propagationFactory = builder.propagationFactory; this.stringPropagation = builder.propagationFactory.create(Propagation.KeyFactory.STRING); this.currentTraceContext = builder.currentTraceContext; this.sampler = builder.sampler;
StackdriverTracePropagation(KeyFactory<K> keyFactory) { this.traceIdKey = keyFactory.create(TRACE_ID_NAME); this.fields = Collections.singletonList(traceIdKey); this.b3Propagation = B3Propagation.FACTORY.create(keyFactory); }
this.errorParser = builder.errorParser; this.propagationFactory = builder.propagationFactory; this.stringPropagation = builder.propagationFactory.create(Propagation.KeyFactory.STRING); this.currentTraceContext = builder.currentTraceContext; this.sampler = builder.sampler;
GrpcPropagation(Factory factory, KeyFactory<K> keyFactory) { this.delegate = factory.delegate.create(keyFactory); this.extraFactory = factory.tagsFactory; }
/** * 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); }
ExtraFieldPropagation(Factory factory, Propagation.KeyFactory<K> keyFactory, List<K> keys) { this.factory = factory; this.delegate = factory.delegate.create(keyFactory); this.keys = keys; }
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; }
GrpcPropagation(Factory factory, KeyFactory<K> keyFactory) { this.delegate = factory.delegate.create(keyFactory); this.extraFactory = factory.tagsFactory; }
/** * 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. */ public HttpTracingService(Service<HttpRequest, HttpResponse> delegate, Tracing tracing) { super(delegate); tracer = tracing.tracer(); extractor = tracing.propagationFactory().create(AsciiStringKeyFactory.INSTANCE) .extractor(HttpHeaders::get); }
ExtraFieldPropagation(Factory factory, Propagation.KeyFactory<K> keyFactory, List<K> keys) { this.factory = factory; this.delegate = factory.delegate.create(keyFactory); this.keys = keys; }