adoroszlai commented on code in PR #11993:
URL: https://github.com/apache/ozone/pull/11993#discussion_r4528210594


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAManagerImpl.java:
##########
@@ -88,7 +90,8 @@ public SCMHAManagerImpl(final ConfigurationSource conf,
     this.scm = scm;
     this.exitManager = new ExitManager();
     this.transactionBuffer = new SCMHADBTransactionBufferImpl(scm);
-    this.ratisServer = new SCMRatisServerImpl(conf, scm, transactionBuffer);
+    this.ratisServer = TracingUtil.createProxy(new SCMRatisServerImpl(conf, 
scm, transactionBuffer),
+        SCMRatisServer.class, SpanKind.INTERNAL);

Review Comment:
   Please use `createInternalProxy` to avoid the need for `SpanKind` import.  
This applies to all other files using the same pattern.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/BlockManagerImpl.java:
##########
@@ -164,13 +166,18 @@ public AllocatedBlock allocateBlock(final long size,
         size, replicationConfig, owner, excludeList);
 
     if (containerInfo != null) {
+      
TracingUtil.addAttributesToCurrentSpan(ScmTracingAttributes.HDDS_CONTAINER_ID, 
containerInfo.getContainerID());
+      TracingUtil.addAttributesToCurrentSpan(ScmTracingAttributes.PIPELINE_ID,
+          containerInfo.getPipelineID().toString());

Review Comment:
   Please change `TracingUtil.addAttributesToCurrentSpan` to accept `Object`, 
and convert `toString()` in it lazily, instead of all callers passing eagerly 
converted strings.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -224,8 +227,11 @@ public List<AllocatedBlock> allocateBlock(
     long startNanos = Time.monotonicNowNanos();
     Map<String, String> auditMap = Maps.newHashMap();
     auditMap.put("size", String.valueOf(size));
+    TracingUtil.addAttributesToCurrentSpan("size", size);
     auditMap.put("num", String.valueOf(num));
+    TracingUtil.addAttributesToCurrentSpan("num", num);
     auditMap.put("replication", replicationConfig.toString());
+    TracingUtil.addAttributesToCurrentSpan("replication", 
replicationConfig.toString());

Review Comment:
   Can we map audit log to tracing in a more generic way, without having to 
duplicate each 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to