You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/02/09 09:37:28 UTC

[GitHub] [skywalking] lxliuxuankb commented on a change in pull request #4327: tag annotation support return expression

lxliuxuankb commented on a change in pull request #4327: tag annotation support return expression
URL: https://github.com/apache/skywalking/pull/4327#discussion_r376768812
 
 

 ##########
 File path: apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java
 ##########
 @@ -54,19 +54,18 @@ public void beforeMethod(
         final Tags tags = method.getAnnotation(Tags.class);
         if (tags != null && tags.value().length > 0) {
             for (final Tag tag : tags.value()) {
-                tagSpan(activeSpan, tag, context);
+                if (!TagUtil.isReturnTag(tag.value())) {
+                    TagUtil.tagParamsSpan(activeSpan, context, tag.key(), tag.value());
+                }
             }
         }
 
         final Tag tag = method.getAnnotation(Tag.class);
-        if (tag != null) {
-            tagSpan(activeSpan, tag, context);
+        if (tag != null && !TagUtil.isReturnTag(tag.value())) {
+            TagUtil.tagParamsSpan(activeSpan, context, tag.key(), tag.value());
         }
     }
 
-    private void tagSpan(final AbstractSpan span, final Tag tag, final Map<String, Object> context) {
 
 Review comment:
   because TraceAnnotationMethodInterceptor  and TagAnnotationMethodInterceptor also have this method, so move this method into TagUtil

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services