|
|
|
@ -23,7 +23,7 @@ import java.util.List;
@@ -23,7 +23,7 @@ import java.util.List;
|
|
|
|
|
import feign.MethodMetadata; |
|
|
|
|
import feign.Target; |
|
|
|
|
import io.micrometer.core.instrument.Tag; |
|
|
|
|
import io.micrometer.core.instrument.config.NamingConvention; |
|
|
|
|
import io.micrometer.core.instrument.Tags; |
|
|
|
|
|
|
|
|
|
public final class FeignMetricName { |
|
|
|
|
|
|
|
|
@ -43,17 +43,17 @@ public final class FeignMetricName {
@@ -43,17 +43,17 @@ public final class FeignMetricName {
|
|
|
|
|
return meteredComponent.getName(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<Tag> tag(MethodMetadata methodMetadata, Target<?> target, Tag... tags) { |
|
|
|
|
public Tags tag(MethodMetadata methodMetadata, Target<?> target, Tag... tags) { |
|
|
|
|
return tag(methodMetadata.targetType(), methodMetadata.method(), target.url(), tags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<Tag> tag(Class<?> targetType, Method method, String url, Tag... extraTags) { |
|
|
|
|
public Tags tag(Class<?> targetType, Method method, String url, Tag... extraTags) { |
|
|
|
|
List<Tag> tags = new ArrayList<>(); |
|
|
|
|
tags.add(Tag.of("client", targetType.getName())); |
|
|
|
|
tags.add(Tag.of("method", method.getName())); |
|
|
|
|
tags.add(Tag.of("host", extractHost(url))); |
|
|
|
|
tags.addAll(Arrays.asList(extraTags)); |
|
|
|
|
return tags; |
|
|
|
|
return Tags.of(tags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String extractHost(final String targetUrl) { |
|
|
|
|