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 2018/08/06 09:47:49 UTC

[GitHub] wu-sheng commented on a change in pull request #1500: [Agent] Provide plugin for Elasticsearch 5.x

wu-sheng commented on a change in pull request #1500: [Agent] Provide plugin for Elasticsearch 5.x
URL: https://github.com/apache/incubator-skywalking/pull/1500#discussion_r207832538
 
 

 ##########
 File path: apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java
 ##########
 @@ -40,13 +40,12 @@
     @Override
     public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
                              Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-        ContextManager.createLocalSpan(ELASTICSEARCH_DB_OP_PREFIX + BASE_FUTURE_METHOD);
     }
 
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
                               Class<?>[] argumentsTypes, Object ret) throws Throwable {
-        AbstractSpan span = ContextManager.activeSpan();
+        AbstractSpan span = ContextManager.createLocalSpan(ELASTICSEARCH_DB_OP_PREFIX + BASE_FUTURE_METHOD);
 
 Review comment:
   @oatiz Why move the create from before to after? This may cause the duration of span is not right. I presume @ascrutae 's idea was asking you to setComponent or setTag in beforeMethod.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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