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.
This commit is contained in:
Pratik Mankawde
2026-05-13 14:40:57 +01:00
parent cf18032e7f
commit 937d11d7c3

View File

@@ -1448,6 +1448,11 @@ PeerImp::handleTransaction(
span->setAttribute(tx_span::attr::peerId, static_cast<int64_t>(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