From de3c3cd7559e879b0fcd89603cbe93d71bea9103 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 12 Jun 2018 12:41:11 +0900 Subject: [PATCH] Add CLIENT_NAME_NONE to WebClientExchangeTags --- .../metrics/web/reactive/client/WebClientExchangeTags.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java index 5dcb729dadd..c70aa216500 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java @@ -45,6 +45,8 @@ public final class WebClientExchangeTags { private static final Pattern PATTERN_BEFORE_PATH = Pattern .compile("^https?://[^/]+/"); + private static final Tag CLIENT_NAME_NONE = Tag.of("clientName", "none"); + private WebClientExchangeTags() { } @@ -104,7 +106,7 @@ public final class WebClientExchangeTags { public static Tag clientName(ClientRequest request) { String host = request.url().getHost(); if (host == null) { - host = "none"; + return CLIENT_NAME_NONE; } return Tag.of("clientName", host); }