You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/25 03:29:21 UTC

[GitHub] [dubbo] twz007 commented on a diff in pull request #11012: Fixed metrics collection getting wrong method name when generalize called

twz007 commented on code in PR #11012:
URL: https://github.com/apache/dubbo/pull/11012#discussion_r1031977476


##########
dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/filter/MetricsCollectExecutor.java:
##########
@@ -88,6 +90,10 @@ private void endExecute(Supplier<Boolean> rtStat){
     private void init(Invocation invocation) {
         String serviceUniqueName = invocation.getTargetServiceUniqueName();
         String methodName = invocation.getMethodName();
+        if (invocation instanceof RpcInvocation &&
+            isGenericCall(((RpcInvocation) invocation).getParameterTypesDesc(), methodName)) {
+            methodName = (String) invocation.getArguments()[0];

Review Comment:
   When generalizing call, the number of parameters must be 3, but it is possible for the array to be out of bounds for some unknown reasons. I will add a check to avoid it.



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org