fix(telemetry): resolve clang-tidy warnings in Telemetry interfaces

Use C++17 concatenated namespaces, add [[nodiscard]] to query methods,
add missing direct includes, and use pass-by-value + std::move in
NullTelemetry constructor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-04-29 11:16:21 +01:00
parent 96470e0c8d
commit d4e91b462e
4 changed files with 27 additions and 25 deletions

View File

@@ -85,8 +85,7 @@
#include <opentelemetry/trace/tracer.h>
#endif
namespace xrpl {
namespace telemetry {
namespace xrpl::telemetry {
class Telemetry
{
@@ -222,27 +221,27 @@ public:
stop() = 0;
/** @return true if this instance is actively exporting spans. */
virtual bool
[[nodiscard]] virtual bool
isEnabled() const = 0;
/** @return true if transaction processing should be traced. */
virtual bool
[[nodiscard]] virtual bool
shouldTraceTransactions() const = 0;
/** @return true if consensus rounds should be traced. */
virtual bool
[[nodiscard]] virtual bool
shouldTraceConsensus() const = 0;
/** @return true if RPC request handling should be traced. */
virtual bool
[[nodiscard]] virtual bool
shouldTraceRpc() const = 0;
/** @return true if peer-to-peer messages should be traced. */
virtual bool
[[nodiscard]] virtual bool
shouldTracePeer() const = 0;
/** @return true if ledger close/accept should be traced. */
virtual bool
[[nodiscard]] virtual bool
shouldTraceLedger() const = 0;
#ifdef XRPL_ENABLE_TELEMETRY
@@ -318,5 +317,4 @@ setup_Telemetry(
std::string const& version,
std::uint32_t networkId);
} // namespace telemetry
} // namespace xrpl
} // namespace xrpl::telemetry