From 937d11d7c3ce54e0648ecc5d90124314e07c2093 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 13 May 2026 14:40:57 +0100 Subject: [PATCH] fix(telemetry): default tx span attrs on receive path Set defaults for tx_span::attr::suppressed (false) and tx_span::attr::status ("new") immediately after creating the txReceive span. Without defaults, spans whose suppressed/status attributes would only be set in the HashRouter-suppressed branch lacked these attributes entirely, producing incomplete span data in downstream stores. The suppressed branch still overrides these when the transaction has already been seen via HashRouter. --- src/xrpld/overlay/detail/PeerImp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 8b8ce7877c..1f19847cda 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -1448,6 +1448,11 @@ PeerImp::handleTransaction( span->setAttribute(tx_span::attr::peerId, static_cast(id_)); if (auto const version = getVersion(); !version.empty()) span->setAttribute(tx_span::attr::peerVersion, version.c_str()); + // Set defaults for conditional attributes so they are always present + // on the span. The suppressed path overrides these when the + // transaction has already been seen via HashRouter. + span->setAttribute(tx_span::attr::suppressed, false); + span->setAttribute(tx_span::attr::status, "new"); // Charge strongly for attempting to relay a txn with tfInnerBatchTxn // LCOV_EXCL_START