diff --git a/include/xrpl/telemetry/Telemetry.h b/include/xrpl/telemetry/Telemetry.h index 21f0440a3d..f297af0223 100644 --- a/include/xrpl/telemetry/Telemetry.h +++ b/include/xrpl/telemetry/Telemetry.h @@ -142,11 +142,9 @@ inline constexpr std::string_view kMeterVersion{"1.0.0"}; * it: telemetry disabled, or an exporter that failed to build. Callers then * need no null check, because an instrument always comes back. * - * Two details are easy to get wrong alone, which is why this is shared: the - * provider must be reached through a base `MeterProvider` pointer, because - * `NoopMeterProvider`'s override hides the base class's defaulted overload; - * and the version must be @ref kMeterVersion, or the meter identity differs - * from the one the histogram views select on. + * Shared so every caller passes the same version, @ref kMeterVersion. A + * different version gives a different meter identity from the one the + * histogram views select on. * * @param name Instrumentation scope name to report. * @return An inert meter. Never empty. diff --git a/src/libxrpl/telemetry/Telemetry.cpp b/src/libxrpl/telemetry/Telemetry.cpp index c18d8c84d1..ae5aac6de8 100644 --- a/src/libxrpl/telemetry/Telemetry.cpp +++ b/src/libxrpl/telemetry/Telemetry.cpp @@ -729,9 +729,9 @@ noopMeter(std::string_view name) { // One provider for the process: it holds a single inert meter, so nothing // is gained by building another. - static auto const provider = opentelemetry::nostd::shared_ptr( + static auto const kProvider = opentelemetry::nostd::shared_ptr( new metrics_api::NoopMeterProvider()); - return provider->GetMeter(std::string(name), std::string(kMeterVersion)); + return kProvider->GetMeter(std::string(name), std::string(kMeterVersion)); } opentelemetry::exporter::otlp::OtlpHttpExporterOptions diff --git a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp index 8d8c6692b0..aaab3e571e 100644 --- a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp +++ b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp @@ -1,7 +1,5 @@ #include -#include -#include #include #include diff --git a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp index b46bbcc90f..753188da4a 100644 --- a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp +++ b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include