Avoid webflux plugin generating many endpoints & optimization http plugin toPath method (#2718)
* Avoid webflux plugin generating many endpoints
This commit is contained in:
parent
7b21c337e0
commit
90fe05b1d9
|
|
@ -46,7 +46,7 @@ public class OnInboundNextInterceptor implements InstanceMethodsAroundIntercepto
|
|||
}
|
||||
|
||||
if (allArguments[1] instanceof HttpRequest) {
|
||||
AbstractSpan span = ContextManager.createEntrySpan(request.uri(), contextCarrier);
|
||||
AbstractSpan span = ContextManager.createEntrySpan(toPath(request.uri()), contextCarrier);
|
||||
Tags.URL.set(span, request.uri());
|
||||
Tags.HTTP.METHOD.set(span, request.method().name());
|
||||
span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
|
||||
|
|
@ -65,4 +65,13 @@ public class OnInboundNextInterceptor implements InstanceMethodsAroundIntercepto
|
|||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
ContextManager.activeSpan().errorOccurred().log(t);
|
||||
}
|
||||
|
||||
private static String toPath(String uri) {
|
||||
int index = uri.indexOf("?");
|
||||
if (index > -1) {
|
||||
return uri.substring(0, index);
|
||||
} else {
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,9 @@ public class HttpClientRequestImplEndInterceptor implements InstanceMethodsAroun
|
|||
}
|
||||
|
||||
private static String toPath(String uri) {
|
||||
if (uri.contains("?")) {
|
||||
return uri.substring(0, uri.indexOf("?"));
|
||||
int index = uri.indexOf("?");
|
||||
if (index > -1) {
|
||||
return uri.substring(0, index);
|
||||
} else {
|
||||
return uri;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,8 +73,9 @@ public class RouterImplAcceptInterceptor implements InstanceMethodsAroundInterce
|
|||
}
|
||||
|
||||
private static String toPath(String uri) {
|
||||
if (uri.contains("?")) {
|
||||
return uri.substring(0, uri.indexOf("?"));
|
||||
int index = uri.indexOf("?");
|
||||
if (index > -1) {
|
||||
return uri.substring(0, index);
|
||||
} else {
|
||||
return uri;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue