Package brave.http

Interface HttpRequestParser

All Known Implementing Classes:
HttpRequestParser.Default

public interface HttpRequestParser
Use this to control the request data recorded for an sampled HTTP client or server span.

Here's an example that changes the span name and records the HTTP url instead of the path.


 httpTracing = httpTracing.toBuilder()
   .clientRequestParser((request, context, span) -> {
     span.name(spanName(adapter, request)); // default span name
     span.tag("http.url", request.url()); // the whole url, not just the path
   }).build();
 
See Also:
HttpResponseParser
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  HttpRequestParser.Default
    The default data policy sets the span name to the HTTP method and adds the "http.method" and "http.path" tags.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static HttpRequestParser DEFAULT  
  • Method Summary

    Modifier and Type Method Description
    void parse​(HttpRequest request, TraceContext context, SpanCustomizer span)
    Implement to choose what data from the http request are parsed into the span representing it.