You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/01/31 00:39:14 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #2901: HBASE-22120 Replace HTrace with OpenTelemetry

Apache9 commented on a change in pull request #2901:
URL: https://github.com/apache/hbase/pull/2901#discussion_r567344329



##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java
##########
@@ -388,44 +392,61 @@ private void onCallFinished(Call call, HBaseRpcController hrc, Address addr,
     }
   }
 
-  Call callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc,
-      final Message param, Message returnType, final User ticket,
-      final Address addr, final RpcCallback<Message> callback) {
-    final MetricsConnection.CallStats cs = MetricsConnection.newCallStats();
-    cs.setStartTime(EnvironmentEdgeManager.currentTime());
-
-    if (param instanceof ClientProtos.MultiRequest) {
-      ClientProtos.MultiRequest req = (ClientProtos.MultiRequest) param;
-      int numActions = 0;
-      for (ClientProtos.RegionAction regionAction : req.getRegionActionList()) {
-        numActions += regionAction.getActionCount();
-      }
+  private Call callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc,
+    final Message param, Message returnType, final User ticket, final Address addr,
+    final RpcCallback<Message> callback) {
+    Span span = TraceUtil.createClientSpan("RpcClient.callMethod")
+      .setAttribute(TraceUtil.RPC_SERVICE_KEY, md.getService().getName())
+      .setAttribute(TraceUtil.RPC_METHOD_KEY, md.getName())
+      .setAttribute(TraceUtil.REMOTE_HOST_KEY, addr.getHostName())
+      .setAttribute(TraceUtil.REMOTE_PORT_KEY, addr.getPort());

Review comment:
       Yes.




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