Interface HttpClientHandler
-
public interface HttpClientHandler
This API is taken from OpenZipkin Brave. This standardizes a way to instrument http clients, particularly in a way that encourages use of portable customizations viaHttpRequestParser
andHttpResponseParser
.- Since:
- 3.0.0
- Author:
- OpenZipkin Brave Authors, Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handleReceive(HttpClientResponse response, Span span)
Finishes the client span after assigning it tags according to the response or error.Span
handleSend(HttpClientRequest request)
Starts the client span after assigning it a name and tags.Span
handleSend(HttpClientRequest request, TraceContext parent)
Same ashandleSend(HttpClientRequest)
but with an explicit parentTraceContext
.
-
-
-
Method Detail
-
handleSend
Span handleSend(HttpClientRequest request)
Starts the client span after assigning it a name and tags. This injects the trace context onto the request before returning. Call this before sending the request on the wire.- Parameters:
request
- to inject the tracing context with- Returns:
- client side span
-
handleSend
Span handleSend(HttpClientRequest request, @Nullable TraceContext parent)
Same ashandleSend(HttpClientRequest)
but with an explicit parentTraceContext
.- Parameters:
request
- to inject the tracing context withparent
-TraceContext
that is to be the client side span's parent- Returns:
- client side span
-
handleReceive
void handleReceive(HttpClientResponse response, Span span)
Finishes the client span after assigning it tags according to the response or error.- Parameters:
response
- the HTTP responsespan
- span to be ended
-
-