Skip to content

Phase 2: Complete RPC tracing — interface, macros, attributes, tests#6424

Draft
pratikmankawde wants to merge 1 commit intopratik/otel-phase1c-rpc-integrationfrom
pratik/otel-phase2-rpc-tracing
Draft

Phase 2: Complete RPC tracing — interface, macros, attributes, tests#6424
pratikmankawde wants to merge 1 commit intopratik/otel-phase1c-rpc-integrationfrom
pratik/otel-phase2-rpc-tracing

Conversation

@pratikmankawde
Copy link
Collaborator

@pratikmankawde pratikmankawde commented Feb 25, 2026

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

High Level Overview of Change

Complete the RPC tracing instrumentation started in the POC phase. Adds the missing shouldTraceLedger() method to the Telemetry interface, introduces XRPL_TRACE_PEER and XRPL_TRACE_LEDGER macros, enhances RPCHandler with duration and error span attributes, and adds a unit test for telemetry config parsing.

Context of Change

Phase 2 of the OpenTelemetry distributed tracing project. The POC (Phase 1) established the core infrastructure — build system integration, Telemetry interface, NullTelemetry stub, SpanGuard RAII, and basic RPC tracing macros. This phase fills in the gaps: the shouldTraceLedger() method was declared in Setup but missing from the virtual interface, and the trace macros for peer and ledger domains were not yet implemented. The RPCHandler span was also missing duration_ms and error_message attributes needed for RED metrics.

Design doc: OpenTelemetryPlan/ directory in this repo.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)

API Impact

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)

Test Plan

  • TelemetryConfig_test covers: Setup struct defaults, empty section parsing, fully populated section parsing, and NullTelemetry factory (start/stop no-ops, all should* return false).
  • Build with telemetry=ON and verify xrpld links.

Future Tasks

  • Phase 3: Transaction tracing with cross-node context propagation
  • Phase 4: Consensus round tracing

@pratikmankawde pratikmankawde added DraftRunCI Normally CI does not run on draft PRs. This opts in. DistributedTracingAndObservability Distributed Tracing And Observability related changes labels Feb 25, 2026
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 52.77778% with 17 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (pratik/otel-phase1c-rpc-integration@b5fb71c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/libxrpl/nodestore/DatabaseNodeImp.cpp 14.3% 6 Missing ⚠️
src/libxrpl/nodestore/backend/RocksDBFactory.cpp 62.5% 3 Missing ⚠️
src/libxrpl/nodestore/backend/MemoryFactory.cpp 50.0% 2 Missing ⚠️
src/libxrpl/nodestore/backend/NuDBFactory.cpp 60.0% 2 Missing ⚠️
src/libxrpl/nodestore/backend/NullFactory.cpp 0.0% 2 Missing ⚠️
src/libxrpl/telemetry/Telemetry.cpp 50.0% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                          Coverage Diff                          @@
##             pratik/otel-phase1c-rpc-integration   #6424   +/-   ##
=====================================================================
  Coverage                                       ?   79.8%           
=====================================================================
  Files                                          ?     850           
  Lines                                          ?   67903           
  Branches                                       ?    7578           
=====================================================================
  Hits                                           ?   54154           
  Misses                                         ?   13749           
  Partials                                       ?       0           
Files with missing lines Coverage Δ
include/xrpl/nodestore/Backend.h 14.3% <ø> (ø)
include/xrpl/telemetry/Telemetry.h 100.0% <ø> (ø)
src/libxrpl/nodestore/DatabaseRotatingImp.cpp 63.9% <100.0%> (ø)
src/libxrpl/telemetry/TelemetryConfig.cpp 100.0% <100.0%> (ø)
src/xrpld/rpc/detail/RPCHandler.cpp 92.4% <100.0%> (ø)
src/libxrpl/nodestore/backend/MemoryFactory.cpp 68.1% <50.0%> (ø)
src/libxrpl/nodestore/backend/NuDBFactory.cpp 64.1% <60.0%> (ø)
src/libxrpl/nodestore/backend/NullFactory.cpp 20.7% <0.0%> (ø)
src/libxrpl/telemetry/Telemetry.cpp 22.5% <50.0%> (ø)
src/libxrpl/nodestore/backend/RocksDBFactory.cpp 49.7% <62.5%> (ø)
... and 1 more

Impacted file tree graph

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

@pratikmankawde pratikmankawde changed the base branch from pratik/OpenTelemetry_and_DistributedTracing_planning to pratik/otel-phase1c-rpc-integration February 26, 2026 16:19
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase1c-rpc-integration branch from a961388 to ff3a7a0 Compare February 27, 2026 17:55
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase2-rpc-tracing branch from ce08aa6 to a288887 Compare February 27, 2026 17:58
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase1c-rpc-integration branch from ff3a7a0 to 1bfdf71 Compare February 27, 2026 18:05
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase2-rpc-tracing branch from a288887 to 761af61 Compare February 27, 2026 18:06
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase1c-rpc-integration branch from 1bfdf71 to b5fb71c Compare February 27, 2026 18:15
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
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