mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 08:00:22 +00:00
Resolve the doCommand error-path span suffix and command attribute against the handler registry instead of using raw request input. A recognized command yields its canonical handler name; anything else (unregistered command, or neither command/method present) collapses to the literal "unknown". This bounds telemetry cardinality to the finite set of handler names plus "unknown" while preserving per-command error attribution for known-but-rejected commands (e.g. a submit that hit rpcTOO_BUSY stays rpc.command.submit). The command attribute is promoted to a Prometheus label by the spanmetrics connector, so attacker-controlled input previously enabled unbounded label cardinality. Also add the missing LCOV_EXCL_STOP in the first SpanGuard::linkedSpan overload so its coverage exclusion no longer bleeds into the second overload's guards. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
XRPL Source Guidelines
Each folder contains a single module following the newest style:
- One class per header
- As much implementation hidden as possible
- All major interfaces are abstract
- Every class is documented
- Each module focuses on solving one problem