fix(telemetry): resolve clang-tidy CI errors in consensus tracing

Add missing <string_view> include in Consensus.h and RCLConsensus.h.
Remove unused SHAMap.h include from RCLConsensus.h.
Add braces around single-line if/else bodies in RCLConsensus.cpp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-07-08 15:22:24 +01:00
parent 87c003230c
commit 749535a3ca
3 changed files with 8 additions and 1 deletions

View File

@@ -1269,11 +1269,15 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr)
// TraceCategory-aware, so gate it explicitly to match the gating
// of the hashSpan/span factories used below.
if (link != nullptr && app_.getTelemetry().shouldTraceConsensus())
{
roundSpan_.emplace(telemetry::SpanGuard::linkedSpan(cs::round, *link));
}
else
{
roundSpan_.emplace(
telemetry::SpanGuard::span(
telemetry::TraceCategory::Consensus, telemetry::seg::consensus, cs::op::round));
}
}
else
{
@@ -1289,7 +1293,9 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr)
}
if (!*roundSpan_)
{
return;
}
roundSpan_->setAttribute(cs::attr::ledgerId, to_string(prevLgr.id()).c_str());
roundSpan_->setAttribute(cs::attr::ledgerSeq, static_cast<int64_t>(prevLgr.seq()) + 1);

View File

@@ -21,7 +21,6 @@
#include <xrpl/protocol/PublicKey.h>
#include <xrpl/protocol/RippleLedgerHash.h>
#include <xrpl/protocol/UintTypes.h>
#include <xrpl/shamap/SHAMap.h>
#include <xrpl/telemetry/SpanGuard.h>
#include <xrpl.pb.h>
@@ -36,6 +35,7 @@
#include <set>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
namespace xrpl {

View File

@@ -26,6 +26,7 @@
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
namespace xrpl {