/** * Returns the status code of the {@link Response}. * * @return the integer value of the {@link #status()}. {@code 0} if the {@link Response} has failed even * before receiving its first non-informational headers. */ default int statusCode() { return status().code(); }
private static void exportStatusCode(Map<String, String> out, RequestLog log) { if (log.isAvailable(RequestLogAvailability.RESPONSE_HEADERS)) { out.put(RES_STATUS_CODE.mdcKey, log.status().codeAsText()); } }
@Override public MeterIdPrefix apply(MeterRegistry registry, RequestLog log) { final List<Tag> tags = buildTags(log); // Add the 'httpStatus' tag. final HttpStatus status; if (log.isAvailable(RequestLogAvailability.RESPONSE_HEADERS)) { status = log.status(); } else { status = HttpStatus.UNKNOWN; } tags.add(Tag.of("httpStatus", status.codeAsText())); return new MeterIdPrefix(name, tags); }
.tag("http.path", log.path()) .tag("http.url", uriBuilder.toString()) .tag("http.status_code", log.status().codeAsText()); final Throwable responseCause = log.responseCause(); if (responseCause != null) {
private static void exportStatusCode(Map<String, String> out, RequestLog log) { if (log.isAvailable(RequestLogAvailability.RESPONSE_HEADERS)) { out.put(RES_STATUS_CODE.mdcKey, log.status().codeAsText()); } }
private static void exportStatusCode(Map<String, String> out, RequestLog log) { if (log.isAvailable(RequestLogAvailability.RESPONSE_HEADERS)) { out.put(RES_STATUS_CODE.mdcKey, log.status().codeAsText()); } }