ctubbsii commented on a change in pull request #2259:
URL: https://github.com/apache/accumulo/pull/2259#discussion_r719627848



##########
File path: 
core/src/main/java/org/apache/accumulo/core/rpc/TraceProtocolFactory.java
##########
@@ -39,17 +40,19 @@
   public TProtocol getProtocol(TTransport trans) {
     return new TCompactProtocol(trans) {
       private Span span = null;
+      private Scope scope = null;
 
       @Override
       public void writeMessageBegin(TMessage message) throws TException {
-        span = TraceUtil.createSpan(this.getClass(), "client:" + message.name, 
SpanKind.CLIENT);
-        span.makeCurrent();
+        span = TraceUtil.createSpan(this.getClass(), message.name, 
SpanKind.CLIENT);
+        scope = span.makeCurrent();
         super.writeMessageBegin(message);
       }
 
       @Override
       public void writeMessageEnd() throws TException {
         super.writeMessageEnd();
+        scope.close();
         span.end();

Review comment:
       Does this order matter?
   
   ```suggestion
           span.end();
           scope.close();
   ```
   
   Since `span.end()` typically updates the stop time for a span, and I suspect 
that `scope.close()` may start triggering exporters, it may be useful to end 
the span before closing the scope.




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


Reply via email to