Skip to content

Phase 3: Transaction tracing — protobuf context, PeerImp, NetworkOPs#6425

Draft
pratikmankawde wants to merge 1 commit intopratik/otel-phase2-rpc-tracingfrom
pratik/otel-phase3-tx-tracing
Draft

Phase 3: Transaction tracing — protobuf context, PeerImp, NetworkOPs#6425
pratikmankawde wants to merge 1 commit intopratik/otel-phase2-rpc-tracingfrom
pratik/otel-phase3-tx-tracing

Conversation

@pratikmankawde
Copy link
Collaborator

@pratikmankawde pratikmankawde commented Feb 25, 2026

PR Chain: #6436#6437#6438#6424#6425 (this PR)#6426#6427#6433 / #6439
Base: pratik/otel-phase2-rpc-tracing

High Level Overview of Change

Add distributed tracing for transaction processing with cross-node trace context propagation. Extends the protobuf schema with a TraceContext message, instruments PeerImp::handleTransaction() and NetworkOPsImp::processTransaction() with trace spans, and provides a TraceContextPropagator utility for serializing W3C trace context over the peer protocol.

Context of Change

Phase 3 of the OpenTelemetry distributed tracing project. Transactions flow across nodes via the peer protocol, so tracing them requires propagating context across process boundaries. The approach uses protobuf extension fields (field number 1001) to carry trace IDs without breaking backward compatibility. The TraceContext message carries trace_id, span_id, trace_flags, and trace_state — matching the W3C Trace Context standard.

The TraceContextPropagator.h header provides extractFromProtobuf() and injectToProtobuf() helpers that are conditionally compiled behind XRPL_ENABLE_TELEMETRY.

Design doc: OpenTelemetryPlan/ directory in this repo.

Type of Change

  • New feature (non-breaking change which adds functionality)

API Impact

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Before / After

Peer protocol messages (TMTransaction, TMProposeSet, TMValidation) gain an optional trace_context field at number 1001. Nodes without telemetry ignore this field — full backward compatibility.

Test Plan

  • Verify protobuf schema compiles and is backward-compatible (optional field at high number).
  • Build with telemetry=ON and verify xrpld links.
  • End-to-end: submit a transaction and verify tx.receivetx.process spans in Jaeger with correct parent-child relationship.

Future Tasks

  • Phase 4: Consensus round tracing
  • Phase 5: Observability dashboards and production deployment config

@pratikmankawde pratikmankawde added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Feb 25, 2026
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase3-tx-tracing branch 2 times, most recently from 04ddafd to 9d7d59a Compare February 25, 2026 22:22
@pratikmankawde pratikmankawde added the DistributedTracingAndObservability Distributed Tracing And Observability related changes label Feb 25, 2026
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 81.57895% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.7%. Comparing base (051a219) to head (f504d9b).

Files with missing lines Patch % Lines
src/xrpld/overlay/detail/PeerImp.cpp 0.0% 5 Missing ⚠️
include/xrpl/telemetry/TraceContextPropagator.h 96.4% 1 Missing ⚠️
src/xrpld/app/misc/NetworkOPs.cpp 80.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                       Coverage Diff                        @@
##           pratik/otel-phase2-rpc-tracing   #6425     +/-   ##
================================================================
- Coverage                            79.8%   79.7%   -0.0%     
================================================================
  Files                                 850     851      +1     
  Lines                               67903   67941     +38     
  Branches                             7578    7587      +9     
================================================================
+ Hits                                54154   54180     +26     
- Misses                              13749   13761     +12     
Files with missing lines Coverage Δ
include/xrpl/telemetry/TraceContextPropagator.h 96.4% <96.4%> (ø)
src/xrpld/app/misc/NetworkOPs.cpp 70.1% <80.0%> (+<0.1%) ⬆️
src/xrpld/overlay/detail/PeerImp.cpp 5.9% <0.0%> (-<0.1%) ⬇️

... and 2 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase2-rpc-tracing branch from 761af61 to 051a219 Compare February 27, 2026 18:16
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase3-tx-tracing branch from 587d312 to f504d9b Compare February 27, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DistributedTracingAndObservability Distributed Tracing And Observability related changes DraftRunCI Normally CI does not run on draft PRs. This opts in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant