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 2021/02/24 07:03:41 UTC

[GitHub] [skywalking] liqiangz opened a new issue #6433: apm-toolkit-opentracing support set Component and SpanLayer.

liqiangz opened a new issue #6433:
URL: https://github.com/apache/skywalking/issues/6433


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [x] Requirement
   - [ ] Feature or performance improvement
   
   ### Requirement or improvement
   - Please describe your requirements or improvement suggestions.
   
   apm-toolkit-opentracing does not support set Component and SpanLayer.  It will shown "Unknown" in skywalking ui.


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784868189


   Yes, you can, take a look at `SkywalkingSpanBuilder`.


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz closed issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz closed issue #6433:
URL: https://github.com/apache/skywalking/issues/6433


   


----------------------------------------------------------------
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



[GitHub] [skywalking] qinshaokang edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
qinshaokang edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-960422997


   I think i got it. Take a look at this method.`org.apache.skywalking.apm.toolkit.opentracing.SkywalkingSpanBuilder#withTag(java.lang.String, java.lang.String)`
   
   ```
   public SpanBuilder withTag(String key, String value) {
           if (Tags.SPAN_KIND.getKey().equals(key)) {
               if (!"client".equals(value) && !"producer".equals(value)) {
                   if (!"server".equals(value) && !"consumer".equals(value)) {
                       this.isEntry = false;
                       this.isExit = false;
                   } else {
                       this.isEntry = true;
                       this.isExit = false;
                   }
               } else {
                   this.isEntry = false;
                   this.isExit = true;
               }
           } else if (!Tags.PEER_HOST_IPV4.getKey().equals(key) && !Tags.PEER_HOST_IPV6.getKey().equals(key) && !Tags.PEER_HOSTNAME.getKey().equals(key)) {
               if (Tags.PEER_SERVICE.getKey().equals(key)) {
                   this.operationName = value;
               } else {
                   this.tags.add(new Tag(key, value));
               }
           } else {
               this.peer = value;
           }
   
           return this;
       }
   ```


-- 
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@skywalking.apache.org

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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?
   like  `skywalking/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/span/SpanSetTagInterceptor.java`
   ```java
       @Override
       public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
           SkywalkingSpanBuilder spanBuilder = (SkywalkingSpanBuilder) allArguments[0];
   
           AbstractSpan span;
           if (spanBuilder.isEntry()) {
               span = ContextManager.createEntrySpan(spanBuilder.getOperationName(), null);
           } else if (spanBuilder.isExit() && (!StringUtil.isEmpty(spanBuilder.getPeer()))) {
               span = ContextManager.createExitSpan(spanBuilder.getOperationName(), buildRemotePeer(spanBuilder));
           } else {
               span = ContextManager.createLocalSpan(spanBuilder.getOperationName());
           }
   
           for (Tag tag : spanBuilder.getTags()) {
               span.tag(Tags.ofKey(tag.getKey()), tag.getValue());
           }
           if (spanBuilder.isError()) {
               span.errorOccurred();
           }
   
           objInst.setSkyWalkingDynamicField(span);
       }
   ```


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?
   like 
   ```java
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                                 Object ret) throws Throwable {
           AbstractSpan activeSpan = ContextManager.activeSpan();
           String tagKey = String.valueOf(allArguments[0]);
           String tagValue = String.valueOf(allArguments[1]);
           if (Tags.PEER_SERVICE.getKey().equals(tagKey)) {
               activeSpan.setOperationName(tagValue);
           } else if (Tags.ERROR.getKey().equals(tagKey) && "true".equals(tagValue)) {
               activeSpan.errorOccurred();
           } else {
               activeSpan.tag(org.apache.skywalking.apm.agent.core.context.tag.Tags.ofKey(tagKey), tagValue);
           }
           return ret;
       }
   ```


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784896767


   thank you for your reply


----------------------------------------------------------------
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



[GitHub] [skywalking] qinshaokang edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
qinshaokang edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-960422997


   I think i got it. Take a look at this method.
   
   ```
   public SpanBuilder withTag(String key, String value) {
           if (Tags.SPAN_KIND.getKey().equals(key)) {
               if (!"client".equals(value) && !"producer".equals(value)) {
                   if (!"server".equals(value) && !"consumer".equals(value)) {
                       this.isEntry = false;
                       this.isExit = false;
                   } else {
                       this.isEntry = true;
                       this.isExit = false;
                   }
               } else {
                   this.isEntry = false;
                   this.isExit = true;
               }
           } else if (!Tags.PEER_HOST_IPV4.getKey().equals(key) && !Tags.PEER_HOST_IPV6.getKey().equals(key) && !Tags.PEER_HOSTNAME.getKey().equals(key)) {
               if (Tags.PEER_SERVICE.getKey().equals(key)) {
                   this.operationName = value;
               } else {
                   this.tags.add(new Tag(key, value));
               }
           } else {
               this.peer = value;
           }
   
           return this;
       }
   ```


-- 
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@skywalking.apache.org

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



[GitHub] [skywalking] qinshaokang commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
qinshaokang commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-960397428


   I also don't understand how to create entrySpan if i use SkywalkingSpanBuilder,could you plese describ how again?


-- 
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@skywalking.apache.org

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



[GitHub] [skywalking] wu-sheng commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784894980


   > @wu-sheng SkywalkingSpanBuilder can't set Component and SpanLayer. Is it only possible to set Component and SpanLayer through the SDK plugin?
   
   I think I replied. You don't explain how. Why you are asking again?


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784896767


   thank you for your reply, Misunderstand your reply above


----------------------------------------------------------------
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



[GitHub] [skywalking] qinshaokang edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
qinshaokang edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-960422997


   I think i got it. Take a look at this method.
   
   `
   public SpanBuilder withTag(String key, String value) {
           if (Tags.SPAN_KIND.getKey().equals(key)) {
               if (!"client".equals(value) && !"producer".equals(value)) {
                   if (!"server".equals(value) && !"consumer".equals(value)) {
                       this.isEntry = false;
                       this.isExit = false;
                   } else {
                       this.isEntry = true;
                       this.isExit = false;
                   }
               } else {
                   this.isEntry = false;
                   this.isExit = true;
               }
           } else if (!Tags.PEER_HOST_IPV4.getKey().equals(key) && !Tags.PEER_HOST_IPV6.getKey().equals(key) && !Tags.PEER_HOSTNAME.getKey().equals(key)) {
               if (Tags.PEER_SERVICE.getKey().equals(key)) {
                   this.operationName = value;
               } else {
                   this.tags.add(new Tag(key, value));
               }
           } else {
               this.peer = value;
           }
   
           return this;
       }
   `


-- 
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@skywalking.apache.org

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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?
   like 
   ```java
   AbstractSpan activeSpan = ContextManager.activeSpan();
           String tagKey = String.valueOf(allArguments[0]);
           String tagValue = String.valueOf(allArguments[1]);
           if (Tags.PEER_SERVICE.getKey().equals(tagKey)) {
               activeSpan.setOperationName(tagValue);
           } else if (Tags.ERROR.getKey().equals(tagKey) && "true".equals(tagValue)) {
               activeSpan.errorOccurred();
           } else {
               activeSpan.tag(org.apache.skywalking.apm.agent.core.context.tag.Tags.ofKey(tagKey), tagValue);
           }
           return ret;
   ```


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?
   like  skywalking/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/span/SpanSetTagInterceptor.java 
   ```java
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                                 Object ret) throws Throwable {
           AbstractSpan activeSpan = ContextManager.activeSpan();
           String tagKey = String.valueOf(allArguments[0]);
           String tagValue = String.valueOf(allArguments[1]);
           if (Tags.PEER_SERVICE.getKey().equals(tagKey)) {
               activeSpan.setOperationName(tagValue);
           } else if (Tags.ERROR.getKey().equals(tagKey) && "true".equals(tagValue)) {
               activeSpan.errorOccurred();
           } else {
               activeSpan.tag(org.apache.skywalking.apm.agent.core.context.tag.Tags.ofKey(tagKey), tagValue);
           }
           return ret;
       }
   ```


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?
   like  `skywalking/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/opentracing/span/SpanSetTagInterceptor.java`
   ```java
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                                 Object ret) throws Throwable {
           AbstractSpan activeSpan = ContextManager.activeSpan();
           String tagKey = String.valueOf(allArguments[0]);
           String tagValue = String.valueOf(allArguments[1]);
           if (Tags.PEER_SERVICE.getKey().equals(tagKey)) {
               activeSpan.setOperationName(tagValue);
           } else if (Tags.ERROR.getKey().equals(tagKey) && "true".equals(tagValue)) {
               activeSpan.errorOccurred();
           } else {
               activeSpan.tag(org.apache.skywalking.apm.agent.core.context.tag.Tags.ofKey(tagKey), tagValue);
           }
           return ret;
       }
   ```


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784854988


   `COMPONENT` in SkyWalking native concept, you are being required a ID, how do that in the OpenTracing API? 
   And I can't see `Layer` in the OT too.
   
   Also, do you know, OT is being abandoned by their maintainers? Check opentracing.io for more details.


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz edited a comment on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz edited a comment on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-opentracing-activation?


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784874434


   @wu-sheng  SkywalkingSpanBuilder can't set Component and SpanLayer.  Is it only possible to set Component and SpanLayer through the SDK plugin?


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784844842


   There is no such thing in the OpenTracing. What can we do?


----------------------------------------------------------------
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



[GitHub] [skywalking] qinshaokang commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
qinshaokang commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-960422997


   I think i got it. Take a look at this method.
   `public SpanBuilder withTag(String key, String value) {
           if (Tags.SPAN_KIND.getKey().equals(key)) {
               if (!"client".equals(value) && !"producer".equals(value)) {
                   if (!"server".equals(value) && !"consumer".equals(value)) {
                       this.isEntry = false;
                       this.isExit = false;
                   } else {
                       this.isEntry = true;
                       this.isExit = false;
                   }
               } else {
                   this.isEntry = false;
                   this.isExit = true;
               }
           } else if (!Tags.PEER_HOST_IPV4.getKey().equals(key) && !Tags.PEER_HOST_IPV6.getKey().equals(key) && !Tags.PEER_HOSTNAME.getKey().equals(key)) {
               if (Tags.PEER_SERVICE.getKey().equals(key)) {
                   this.operationName = value;
               } else {
                   this.tags.add(new Tag(key, value));
               }
           } else {
               this.peer = value;
           }
   
           return this;
       }`


-- 
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@skywalking.apache.org

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



[GitHub] [skywalking] liqiangz commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784849111


   @wu-sheng   When we set Tag like `Tags.COMPONENT.set(span, "jersey")`,   maybe we can get the tag value and setComponent in apm-toolkit-trace-activation?


----------------------------------------------------------------
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



[GitHub] [skywalking] liqiangz commented on issue #6433: apm-toolkit-opentracing support seting Component and SpanLayer.

Posted by GitBox <gi...@apache.org>.
liqiangz commented on issue #6433:
URL: https://github.com/apache/skywalking/issues/6433#issuecomment-784866470


   @wu-sheng apm-toolkit-trace can only create localSpan. Besides using apm-toolkit-opentracing and sdk plugins, is there any other way to create entrySpan and exitSpan?


----------------------------------------------------------------
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