ArafatKhan2198 commented on code in PR #12145:
URL: https://github.com/apache/ozone/pull/12145#discussion_r4696523894
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSCMRatisServerImpl.java:
##########
@@ -232,6 +243,82 @@ public void testGetRatisRolesKeepsHostname() throws
Exception {
}
}
+ @Test
+ public void testSubmitRequestIsTracedUnderTheCurrentSpan() throws Exception {
+ ArgumentCaptor<RaftClientRequest> submitted =
ArgumentCaptor.forClass(RaftClientRequest.class);
+ SCMRatisServerImpl scmRatisServer = newScmRatisServer(submitted, null);
+ SCMRatisRequest request = SCMRatisRequest.of(RequestType.PIPELINE, "op",
new Class<?>[0]);
+
+ try (TestSpanCollector collector = TestSpanCollector.install("scm")) {
+ TracingUtil.executeInNewSpan("request", () ->
scmRatisServer.submitRequest(request));
+
+ collector.assertParent("SCMRatisServerImpl.submit.op", "request");
+ // The request is encoded inside the span, so the apply span on each SCM
continues from it.
+ String traceID =
SCMRatisRequest.decode(submitted.getValue().getMessage()).getTraceID();
+ TracingUtil.executeAsChildSpan("apply", traceID, () -> { });
+ collector.assertParent("apply", "SCMRatisServerImpl.submit.op");
+ }
+ }
+
Review Comment:
Thanks, understood. My concern is that if an operator searches for a
specific Ozone error code in Jaeger some failures might not show up.
Could we make error codes searchable in the same way across all SCM
protocols wherever possible?
I'm fine with taking this up separately if needed.
--
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]