diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index d7221e2c21..95f72bde15 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -14,13 +14,15 @@ #include #include #include -#include #include #include #include +#include #include +#include #include +#include #include #include #include diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index df62dc36f1..0305ce7c4e 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/app/ledger/detail/LedgerSpanNames.h b/src/xrpld/app/ledger/detail/LedgerSpanNames.h index f6b5af6c51..4d24a60b2e 100644 --- a/src/xrpld/app/ledger/detail/LedgerSpanNames.h +++ b/src/xrpld/app/ledger/detail/LedgerSpanNames.h @@ -15,9 +15,7 @@ #include -namespace xrpl { -namespace telemetry { -namespace ledger_span { +namespace xrpl::telemetry::ledger_span { // ===== Span operation suffixes =============================================== @@ -49,6 +47,4 @@ inline constexpr auto txFailed = join(xrplLedger, makeStr("tx_failed")); inline constexpr auto validations = join(xrplLedger, makeStr("validations")); } // namespace attr -} // namespace ledger_span -} // namespace telemetry -} // namespace xrpl +} // namespace xrpl::telemetry::ledger_span diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index ef3d456055..888aa1b8cc 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -68,6 +68,7 @@ #include #include #include +#include #include #include @@ -1966,17 +1967,16 @@ PeerImp::onMessage(std::shared_ptr const& m) app_.getTimeKeeper().closeTime(), calcNodeID(app_.getValidatorManifests().getMasterKey(publicKey))}); - // Create a receive span that links to the sender's trace context - // (if propagated). shared_ptr keeps it alive across the job boundary. - auto span = std::make_shared(telemetry::proposalReceiveSpan(set)); - span->setAttribute(telemetry::cons_span::attr::trusted, isTrusted); - span->setAttribute(telemetry::cons_span::attr::round, static_cast(set.proposeseq())); + auto consSpan = std::make_shared(telemetry::proposalReceiveSpan(set)); + consSpan->setAttribute(telemetry::cons_span::attr::trusted, isTrusted); + consSpan->setAttribute( + telemetry::cons_span::attr::round, static_cast(set.proposeseq())); std::weak_ptr const weak = shared_from_this(); app_.getJobQueue().addJob( isTrusted ? jtPROPOSAL_t : jtPROPOSAL_ut, "checkPropose", - [weak, isTrusted, m, proposal, sp = std::move(span)]() { + [weak, isTrusted, m, proposal, sp = std::move(consSpan)]() { if (auto peer = weak.lock()) peer->checkPropose(isTrusted, m, proposal); }); @@ -2560,13 +2560,12 @@ PeerImp::onMessage(std::shared_ptr const& m) return; } - // Create a receive span that links to the sender's trace context - // (if propagated). shared_ptr keeps it alive across the job boundary. - auto span = std::make_shared(telemetry::validationReceiveSpan(*m)); - span->setAttribute(telemetry::cons_span::attr::trusted, isTrusted); + auto consSpan = + std::make_shared(telemetry::validationReceiveSpan(*m)); + consSpan->setAttribute(telemetry::cons_span::attr::trusted, isTrusted); if (val->isFieldPresent(sfLedgerSequence)) { - span->setAttribute( + consSpan->setAttribute( telemetry::cons_span::attr::ledgerSeq, static_cast(val->getFieldU32(sfLedgerSequence))); } @@ -2583,7 +2582,7 @@ PeerImp::onMessage(std::shared_ptr const& m) app_.getJobQueue().addJob( isTrusted ? jtVALIDATION_t : jtVALIDATION_ut, name, - [weak, val, m, key, sp = std::move(span)]() { + [weak, val, m, key, sp = std::move(consSpan)]() { if (auto peer = weak.lock()) peer->checkValidation(val, key, m); }); diff --git a/src/xrpld/overlay/detail/PeerSpanNames.h b/src/xrpld/overlay/detail/PeerSpanNames.h index cbeeed528b..9697ea3fa4 100644 --- a/src/xrpld/overlay/detail/PeerSpanNames.h +++ b/src/xrpld/overlay/detail/PeerSpanNames.h @@ -13,9 +13,7 @@ #include -namespace xrpl { -namespace telemetry { -namespace peer_span { +namespace xrpl::telemetry::peer_span { // ===== Span operation suffixes =============================================== @@ -45,6 +43,4 @@ inline constexpr auto validationTrusted = join(join(xrplPeer, makeStr("validation")), makeStr("trusted")); } // namespace attr -} // namespace peer_span -} // namespace telemetry -} // namespace xrpl +} // namespace xrpl::telemetry::peer_span