/** * Override to change what data from the http error are parsed into the span modeling it. By * default, this tags "error" as the exception or the status code if it is neither 2xx nor 3xx. * * <p>Note: Either the httpStatus or error parameters may be null, but not both * * <p>Conventionally associated with the tag key "error" */ // BRAVE6: httpStatus is a Integer, not a int. We can't change this api as users expect this to be // called by default. Unfortunately, this implies boxing until we can change it. protected void error(@Nullable Integer httpStatus, @Nullable Throwable error, SpanCustomizer customizer) { if (error != null) { errorParser().error(error, customizer); } else if (httpStatus != null) { String maybeErrorStatus = maybeStatusAsString(httpStatus, 399); if (maybeErrorStatus != null) customizer.tag("error", maybeErrorStatus); } }
String nameFromRoute = spanNameFromRoute(adapter, res, statusCode); if (nameFromRoute != null) customizer.name(nameFromRoute); String maybeStatus = maybeStatusAsString(statusCode, 299); if (maybeStatus != null) customizer.tag("http.status_code", maybeStatus);