From f5fff9b5f9d2bf8dd550ea8d4bcbeed49a7ac7b7 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 3 Sep 2026 18:44:04 +0100 Subject: [PATCH] fix(telemetry): wire the metric export cadence constants to the reader kMetricExportInterval and kMetricExportTimeout were declared but the reader options set the same values as literals, so both constants were unused. constexpr at namespace scope has internal linkage, so clang reports them under -Wunused-const-variable, which -Dwerr=ON makes fatal: it failed the compile on ubuntu-clang-release-amd64 and macos-arm64-release, and clang-tidy as well. Using them removes two magic numbers and keeps the comment that explains why the interval is 1 s. --- src/libxrpl/telemetry/Telemetry.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libxrpl/telemetry/Telemetry.cpp b/src/libxrpl/telemetry/Telemetry.cpp index 7b54b76c8d..aa7cec6a6f 100644 --- a/src/libxrpl/telemetry/Telemetry.cpp +++ b/src/libxrpl/telemetry/Telemetry.cpp @@ -543,11 +543,9 @@ public: auto metricExporter = otlp_http::OtlpHttpMetricExporterFactory::Create(metricExporterOpts); - // Configure periodic metric reader (1-second export interval, - // matching the beast OTelCollector path). metrics_sdk::PeriodicExportingMetricReaderOptions readerOpts; - readerOpts.export_interval_millis = std::chrono::milliseconds(1000); - readerOpts.export_timeout_millis = std::chrono::milliseconds(500); + readerOpts.export_interval_millis = kMetricExportInterval; + readerOpts.export_timeout_millis = kMetricExportTimeout; auto reader = metrics_sdk::PeriodicExportingMetricReaderFactory::Create( std::move(metricExporter), readerOpts);