mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 09:16:47 +00:00
fix(telemetry): eliminate duplicate suppressed attribute on tx.receive span
The OTel C++ SDK's SetAttribute appends rather than overwrites on in-flight spans. Setting suppressed=false as a default then overriding to true resulted in both values appearing in the exported span. Fix: remove the default-false set, place suppressed=false once after the HashRouter check passes (non-suppressed path), and suppressed=true remains only in the suppressed path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1334,11 +1334,8 @@ PeerImp::handleTransaction(
|
||||
span->setAttribute(tx_span::attr::txType, fmt->getName().c_str());
|
||||
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::txStatus, "new");
|
||||
// Note: suppressed and txStatus are set once at each exit path
|
||||
// (not as defaults here) to avoid OTel SDK attribute duplication.
|
||||
|
||||
// Charge strongly for attempting to relay a txn with tfInnerBatchTxn
|
||||
// LCOV_EXCL_START
|
||||
@@ -1403,6 +1400,7 @@ PeerImp::handleTransaction(
|
||||
return;
|
||||
}
|
||||
|
||||
span->setAttribute(tx_span::attr::suppressed, false);
|
||||
JLOG(pJournal_.debug()) << "Got tx " << txID;
|
||||
|
||||
bool checkSignature = true;
|
||||
|
||||
Reference in New Issue
Block a user