wu-sheng commented on code in PR #265:
URL: https://github.com/apache/skywalking-java/pull/265#discussion_r909450241
##########
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:
If this can't be, we should polish UTs. I can't get the point of an HTTP w/o
method, which is illegal.
--
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]