Skip to content

RATIS-2398. Add opentelemetry-javaagent to ratis-examples and assembly#1428

Open
taklwu wants to merge 2 commits intoapache:masterfrom
taklwu:RATIS-2398
Open

RATIS-2398. Add opentelemetry-javaagent to ratis-examples and assembly#1428
taklwu wants to merge 2 commits intoapache:masterfrom
taklwu:RATIS-2398

Conversation

@taklwu
Copy link
Copy Markdown
Contributor

@taklwu taklwu commented Apr 15, 2026

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

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}
  1. export traces to the third party otlp e.g. Jaegar
Screenshot 2026-04-15 at 3 39 32 PM

taklwu added 2 commits April 15, 2026 15:41
also fixed a bug that client need to issue the parent span in the client request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant