taklwu opened a new pull request, #1428:
URL: https://github.com/apache/ratis/pull/1428

   also fixed a bug that client need to issue the parent span in the client 
request
   
   ## What changes were proposed in this pull request?
   
   - make an example of how to use tracing in ratis-examples
   - make sure the script could be automatically running and span shows in the 
logs and Jaegar UI
   - fix the parent span issued from the client.
   
   ## What is the link to the Apache JIRA
   
   [RATIS-2389](https://issues.apache.org/jira/browse/RATIS-2389)
   
   ## How was this patch tested?
   manual tests for running the 
https://github.com/apache/ratis/tree/master/ratis-examples locally, tested with 
below
   
   1. logger mode that emits span in logs
   
   ```
   # on the server 
   [otel.javaagent 2026-04-15 15:40:24:419 -0700] [pool-3-thread-1] INFO 
io.opentelemetry.exporter.logging.LoggingSpanExporter - 
'raft.server.submitClientRequestAsync' : 2a9bfd5258de404d4c8dcd291408538f 
98677058d4b31a8e SERVER [tracer: org.apache.ratis:3.3.0-SNAPSHOT] 
AttributesMap{data={thread.id=69, thread.name=n0-client-thread1, 
raft.member.id=n0@group-6F7570313233, raft.call.id=51198, 
raft.client.id=client-5813AB26C91D}, capacity=128, totalAddedValues=5}
   [otel.javaagent 2026-04-15 15:40:24:419 -0700] [pool-3-thread-2] INFO 
io.opentelemetry.exporter.logging.LoggingSpanExporter - 
'raft.server.submitClientRequestAsync' : f56c5fe25544695b023cfcdcd4f32447 
57fd34b224ee3d6a SERVER [tracer: org.apache.ratis:3.3.0-SNAPSHOT] 
AttributesMap{data={thread.id=69, thread.name=n0-client-thread1, 
raft.member.id=n0@group-6F7570313233, raft.call.id=51196, 
raft.client.id=client-5813AB26C91D}, capacity=128, totalAddedValues=5}
   
   # from the client 
   [otel.javaagent 2026-04-15 15:40:24:420 -0700] [grpc-default-executor-7] 
INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'Async::send' : 
3326eebb2357274628d3dea57e586435 2715719eb0c38ec3 CLIENT [tracer: 
org.apache.ratis:3.3.0-SNAPSHOT] AttributesMap{data={thread.id=37, 
raft.peer.id=LEADER, thread.name=pool-1-thread-20, raft.operation.type=RW, 
raft.operation.name=Async::send}, capacity=128, totalAddedValues=5}
   ```
   
   2. export traces to the third party otlp e.g. Jaegar 
   
   <img width="1869" height="780" alt="Screenshot 2026-04-15 at 3 39 32 PM" 
src="https://github.com/user-attachments/assets/d746ff76-1153-4122-b588-8802c4f4ea79";
 />
   
   


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