Skip to content

Phase 5b: Add ledger/peer/tx spans + expand Grafana dashboards#6433

Draft
pratikmankawde wants to merge 1 commit intopratik/otel-phase5-docs-deploymentfrom
pratik/otel-phase5b-spans
Draft

Phase 5b: Add ledger/peer/tx spans + expand Grafana dashboards#6433
pratikmankawde wants to merge 1 commit intopratik/otel-phase5-docs-deploymentfrom
pratik/otel-phase5b-spans

Conversation

@pratikmankawde
Copy link
Collaborator

@pratikmankawde pratikmankawde commented Feb 26, 2026

PR Chain: #6436#6437#6438#6424#6425#6426#6427#6433 (this PR) / #6439
Base: pratik/otel-phase5-docs-deployment

High Level Overview of Change

Add 6 new OpenTelemetry spans to instrument ledger building, ledger validation,
ledger storage, transaction application, and peer proposal/validation message
receipt. Expand all Grafana dashboards from 4 to 8 panels each and add 2 new
dashboards (Ledger Operations, Peer Network), bringing the total to 32 panels
across 5 dashboards. Each panel now includes a description explaining what it
shows and how the PromQL query calculates the metric.

Context of Change

Phase 5a (the base branch pratik/otel-phase5-docs-deployment) delivered
consensus spans, the observability stack (otel-collector, Jaeger, Prometheus,
Grafana), and integration tests. During review, we identified that the
trace_ledger config category existed with its XRPL_TRACE_LEDGER macro but
had zero spans using it, and trace_peer had only 1 span (tx.receive).
Dashboard panels were limited to 4 per dashboard with no panel descriptions.

This PR fills those gaps:

New spans (6, bringing total from 10 to 16):

Span File Category Key Attributes
ledger.build BuildLedger.cpp:31 trace_ledger xrpl.ledger.seq
ledger.validate LedgerMaster.cpp:915 trace_ledger xrpl.ledger.seq, xrpl.ledger.validations
ledger.store LedgerMaster.cpp:409 trace_ledger xrpl.ledger.seq
tx.apply BuildLedger.cpp:88 trace_transactions xrpl.ledger.tx_count, xrpl.ledger.tx_failed
peer.proposal.receive PeerImp.cpp:1667 trace_peer xrpl.peer.id, xrpl.peer.proposal.trusted
peer.validation.receive PeerImp.cpp:2264 trace_peer xrpl.peer.id, xrpl.peer.validation.trusted

Dashboard changes (12 → 32 panels):

  • RPC Performance: 4 → 8 panels (+ throughput, success/error, top commands, WebSocket)
  • Transaction Overview: 4 → 8 panels (+ heatmap, tx.apply duration, peer receive, failed rate)
  • Consensus Health: 4 → 8 panels (+ mode tracking, accept vs close, validation vs close, heatmap)
  • Ledger Operations: NEW, 8 panels (build/validate/store rates and durations)
  • Peer Network: NEW, 4 panels (proposal/validation receive, trusted vs untrusted)

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)
  • Documentation update

API Impact

None. This change only adds internal observability instrumentation (OpenTelemetry
spans) and Docker-based Grafana dashboards. No public API, libxrpl, or peer
protocol changes.

Test Plan

Integration test (bash docker/telemetry/integration-test.sh) passes 24/24
with all 16 span types verified across a 6-node consensus network:

  • Phase 2 (RPC): rpc.request, rpc.process, rpc.command.* — 5 traces each
  • Phase 3 (TX): tx.process, tx.receive, tx.apply — 5 traces each
  • Phase 4 (Consensus): consensus.proposal.send, consensus.ledger_close, consensus.accept, consensus.validation.send — 5 traces each
  • Phase 5 (Ledger): ledger.build, ledger.validate, ledger.store — 5 traces each
  • Phase 5 (Peer): peer.proposal.receive, peer.validation.receive — 5 traces each
  • Spanmetrics: 22 Prometheus series with duration histograms
  • Grafana: healthy with 5 dashboards, 32 panels

@pratikmankawde pratikmankawde added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Feb 26, 2026
@pratikmankawde pratikmankawde changed the title Pratik/otel phase5b spans Phase 5b: Add ledger/peer/tx spans + expand Grafana dashboards Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 43.75000% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (pratik/otel-phase5-docs-deployment@85f583f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/xrpld/overlay/detail/PeerImp.cpp 0.0% 6 Missing ⚠️
src/xrpld/app/ledger/detail/LedgerMaster.cpp 40.0% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                         Coverage Diff                          @@
##             pratik/otel-phase5-docs-deployment   #6433   +/-   ##
====================================================================
  Coverage                                      ?   79.7%           
====================================================================
  Files                                         ?     851           
  Lines                                         ?   67968           
  Branches                                      ?    7607           
====================================================================
  Hits                                          ?   54182           
  Misses                                        ?   13786           
  Partials                                      ?       0           
Files with missing lines Coverage Δ
src/xrpld/app/ledger/detail/BuildLedger.cpp 92.9% <100.0%> (ø)
src/xrpld/app/ledger/detail/LedgerMaster.cpp 42.7% <40.0%> (ø)
src/xrpld/overlay/detail/PeerImp.cpp 5.8% <0.0%> (ø)

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-phase5-docs-deployment branch from 56cc5e6 to 85f583f Compare February 27, 2026 18:16
@pratikmankawde pratikmankawde force-pushed the pratik/otel-phase5b-spans branch from 4fce0da to e2b2589 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

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