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



##########
File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/ThriftClientHandler.java
##########
@@ -976,17 +1008,31 @@ public void update(TInfo tinfo, TCredentials 
credentials, TKeyExtent tkeyExtent,
         // Instead of always looping on true, skip completely when durability 
is NONE.
         while (durability != Durability.NONE) {
           try {
-            try (TraceScope wal = Trace.startSpan("wal")) {
+            Span span2 = 
tracer.spanBuilder("ThriftClientHandler::update::wal").startSpan();
+            try (Scope scope = span2.makeCurrent()) {
               server.logger.log(session, mutation, durability);
+            } catch (Exception e) {
+              span2.recordException(e, 
Attributes.builder().put("exception.message", e.getMessage())
+                  .put("exception.escaped", true).build());
+              throw e;
+            } finally {
+              span2.end();
             }
             break;
           } catch (IOException ex) {
             log.warn("Error writing mutations to log", ex);
           }
         }
 
-        try (TraceScope commit = Trace.startSpan("commit")) {
+        Span span3 = 
tracer.spanBuilder("ThriftClientHandler::update::commit").startSpan();

Review comment:
       Take a look at TraceUtil.wrapService(). This method is called to wrap 
all of the Thrift servers and it takes the TInfo coming across the wire and 
creates a Context object from it and sets it as the current context for the 
call.




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