Package brave.http

Class HttpResponseParser.Default

  • All Implemented Interfaces:
    HttpResponseParser
    Enclosing interface:
    HttpResponseParser

    public static class HttpResponseParser.Default
    extends Object
    implements HttpResponseParser
    The default data policy sets the span name to the HTTP route when available, along with the "http.status_code" and "error" tags.

    Route-based span name

    If routing is supported, and a GET didn't match due to 404, the span name will be "get not_found". If it didn't match due to redirect, the span name will be "get redirected". If routing is not supported, the span name is left alone.
    • Constructor Detail

      • Default

        public Default()
    • Method Detail

      • error

        protected void error​(int httpStatus,
                             @Nullable
                             Throwable error,
                             SpanCustomizer span)
        Override to change what data from the HTTP error are parsed into the span modeling it. By default, this tags "error" as the the status code, if the error parameter was null and the HTTP status is below 1xx or above 3xx.

        Note: Either the httpStatus can be zero or the error parameter null, but not both. This does not parse the error, as it is assumed that the has done so prior.

        Conventionally associated with the tag key "error"