diff --git a/include/xrpl/telemetry/Telemetry.h b/include/xrpl/telemetry/Telemetry.h index fcc8fb8ad8..3b2309edfc 100644 --- a/include/xrpl/telemetry/Telemetry.h +++ b/include/xrpl/telemetry/Telemetry.h @@ -91,6 +91,7 @@ #include #include +#include #include #include #include diff --git a/include/xrpl/telemetry/TraceContextValidation.h b/include/xrpl/telemetry/TraceContextValidation.h index c1039d1e53..1c1554acf0 100644 --- a/include/xrpl/telemetry/TraceContextValidation.h +++ b/include/xrpl/telemetry/TraceContextValidation.h @@ -46,7 +46,6 @@ #include #include -#include #include namespace xrpl::telemetry { diff --git a/src/libxrpl/telemetry/Redaction.cpp b/src/libxrpl/telemetry/Redaction.cpp index ee15b8812e..d6bfe52ec3 100644 --- a/src/libxrpl/telemetry/Redaction.cpp +++ b/src/libxrpl/telemetry/Redaction.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -23,9 +24,8 @@ redactAccount(std::string_view addr) // staying non-reversible — and lowercase them for a stable token. auto const digest = sha512Half(Slice(addr.data(), addr.size())); std::string token = to_string(digest).substr(0, 16); - std::transform(token.begin(), token.end(), token.begin(), [](unsigned char c) { - return static_cast(std::tolower(c)); - }); + std::ranges::transform( + token, token.begin(), [](unsigned char c) { return static_cast(std::tolower(c)); }); return token; } diff --git a/src/libxrpl/telemetry/Telemetry.cpp b/src/libxrpl/telemetry/Telemetry.cpp index dee4736674..2361e14e52 100644 --- a/src/libxrpl/telemetry/Telemetry.cpp +++ b/src/libxrpl/telemetry/Telemetry.cpp @@ -280,7 +280,9 @@ public: otlp_http::OtlpHttpExporterOptions exporterOpts; exporterOpts.url = setup_.exporterEndpoint; if (setup_.useTls) + { exporterOpts.ssl_ca_cert_path = setup_.tlsCertPath; + } auto exporter = otlp_http::OtlpHttpExporterFactory::Create(exporterOpts); @@ -406,7 +408,9 @@ public: getTracer(std::string_view name = kTracerName) override { if (!sdkProvider_) + { return trace_api::Provider::GetTracerProvider()->GetTracer(std::string(name)); + } return sdkProvider_->GetTracer(std::string(name)); } @@ -439,7 +443,9 @@ std::unique_ptr makeTelemetry(Telemetry::Setup const& setup, beast::Journal journal) { if (setup.enabled) + { return std::make_unique(setup, journal); + } return std::make_unique(setup); } diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index e2752ba67b..daafb4c6e4 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tests/libxrpl/telemetry/Redaction.cpp b/src/tests/libxrpl/telemetry/Redaction.cpp index 7f16c0f1dc..db1cc95135 100644 --- a/src/tests/libxrpl/telemetry/Redaction.cpp +++ b/src/tests/libxrpl/telemetry/Redaction.cpp @@ -4,6 +4,7 @@ #include #include +#include #include using namespace xrpl; @@ -28,7 +29,7 @@ TEST(Redaction, token_is_16_lowercase_hex_and_stable) { auto const token = redactAccount("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"); EXPECT_EQ(token.size(), 16u); - EXPECT_TRUE(std::all_of(token.begin(), token.end(), [](unsigned char c) { + EXPECT_TRUE(std::ranges::all_of(token, [](unsigned char c) { return std::isdigit(c) || (c >= 'a' && c <= 'f'); })); // Deterministic: hashing the same input twice yields the same token.