Class HttpTracing
- java.lang.Object
-
- brave.http.HttpTracing
-
public class HttpTracing extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpTracing.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpTracingclientOf(String serverName)Scopes this component for a client of the indicated server.HttpClientParserclientParser()HttpSamplerclientSampler()Returns an overriding sampling decision for a new trace.static HttpTracingcreate(brave.Tracing tracing)static HttpTracing.BuildernewBuilder(brave.Tracing tracing)StringserverName()Used by http clients to indicate the name of the destination service.HttpServerParserserverParser()HttpSamplerserverSampler()Returns an overriding sampling decision for a new trace.HttpTracing.BuildertoBuilder()brave.Tracingtracing()
-
-
-
Method Detail
-
create
public static HttpTracing create(brave.Tracing tracing)
-
newBuilder
public static HttpTracing.Builder newBuilder(brave.Tracing tracing)
-
tracing
public brave.Tracing tracing()
-
clientParser
public HttpClientParser clientParser()
-
serverName
public String serverName()
Used by http clients to indicate the name of the destination service. Defaults to "", which will not show in the zipkin UI or end up in the dependency graph.When present, a link from
Tracing.Builder.localServiceName(String)to this name will increment for each traced client call.As this is endpoint-specific, it is typical to create a scoped instance of HttpTracing to assign this value. For example:
github = TracingHttpClientBuilder.create(httpTracing.serverName("github"));- See Also:
HttpClientAdapter.parseServerIpAndPort(Object, Endpoint.Builder),Span.remoteEndpoint(Endpoint)
-
clientOf
public HttpTracing clientOf(String serverName)
Scopes this component for a client of the indicated server.- See Also:
serverName()
-
serverParser
public HttpServerParser serverParser()
-
clientSampler
public HttpSampler clientSampler()
Returns an overriding sampling decision for a new trace. Defaults to ignore the request and use thetrace ID instead.This decision happens when a trace was not yet started in process. For example, you may be making an http request as a part of booting your application. You may want to opt-out of tracing client requests that did not originate from a server request.
-
serverSampler
public HttpSampler serverSampler()
Returns an overriding sampling decision for a new trace. Defaults to ignore the request and use thetrace ID instead.This decision happens when trace IDs were not in headers, or a sampling decision has not yet been made. For example, if a trace is already in progress, this function is not called. You can implement this to skip paths that you never want to trace.
-
toBuilder
public HttpTracing.Builder toBuilder()
-
-