Leibnizhu commented on code in PR #265:
URL: https://github.com/apache/skywalking-java/pull/265#discussion_r909454639
##########
apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v4/server/SynchronousDispatcherInterceptor.java:
##########
@@ -50,13 +50,22 @@ public void beforeMethod(EnhancedInstance objInst, Method
method, Object[] allAr
next.setHeadValue(request.getHttpHeaders().getHeaderString(next.getHeadKey()));
}
- AbstractSpan span =
ContextManager.createEntrySpan(request.getHttpMethod() + ":" +
request.getUri().getPath(), contextCarrier);
+ String operationName = toOperationName(request);
+ AbstractSpan span = ContextManager.createEntrySpan(operationName,
contextCarrier);
span.tag(Tags.URL,
toPath(request.getUri().getRequestUri().toString()));
span.tag(Tags.HTTP.METHOD, request.getHttpMethod());
span.setComponent(ComponentsDefine.RESTEASY);
SpanLayer.asHttp(span);
}
+ private String toOperationName(HttpRequest request) {
+ if (request.getHttpMethod() == null) {
Review Comment:
yep, it is unnecessary. The reason for previous CI test's failure is
imperfect mocking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]