Package brave.http
Interface HttpResponseParser
-
- All Known Implementing Classes:
HttpResponseParser.Default
public interface HttpResponseParserUse this to control the response data recorded for ansampled HTTP client or server span.Here's an example that adds all HTTP status codes, not just the error ones.
httpTracing = httpTracing.toBuilder() .clientResponseParser((response, context, span) -> { HttpResponseParser.DEFAULT.parse(response, context, span); HttpTags.STATUS_CODE.tag(response, context, span); }).build();Note: This type is safe to implement as a lambda, or use as a method reference as it is effectively a
FunctionalInterface. It isn't annotated as such because the project has a minimum Java language level 6.- Since:
- 5.10
- See Also:
HttpRequestParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHttpResponseParser.DefaultThe default data policy sets the span name to the HTTP route when available, along with the "http.status_code" and "error" tags.
-
Field Summary
Fields Modifier and Type Field Description static HttpResponseParserDEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidparse(HttpResponse response, brave.propagation.TraceContext context, brave.SpanCustomizer span)Implement to choose what data from the http response are parsed into the span representing it.
-
-
-
Field Detail
-
DEFAULT
static final HttpResponseParser DEFAULT
-
-
Method Detail
-
parse
void parse(HttpResponse response, brave.propagation.TraceContext context, brave.SpanCustomizer span)
Implement to choose what data from the http response are parsed into the span representing it.Note: This is called after
Span.error(Throwable). Conventionally, Zipkin handlers will not overwrite a tag named "error" if you set it here based on the response.- See Also:
HttpResponseParser.Default
-
-