From 494984112afa1c9cb0f2f0544b78bd1a85a9f59b Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:51:02 +0100 Subject: [PATCH] fix(telemetry): add getMeter override to test mock (originating branch) getMeter() became a pure virtual on THIS branch (native-metrics), which makes the TestTelemetry mock abstract and would break a telemetry=ON build of phase7/phase8 in isolation. The override was previously only on phase9 (where it was mis-attributed); relocate it to phase7 where the pure virtual is introduced, so every branch from here forward builds. Mirrors NullTelemetry: an inert meter from a process-wide noop provider. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/tests/libxrpl/telemetry/SpanGuardScope.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp index db3796e09c..7c3cdd88ba 100644 --- a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp +++ b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -152,6 +155,19 @@ public: return provider_->GetTracer(std::string(name)); } + /** + * @return A meter from a noop provider; the scope tests exercise only + * tracing, so metrics instruments are inert. + */ + opentelemetry::nostd::shared_ptr + getMeter(std::string_view name) override + { + static auto noopProvider = + opentelemetry::nostd::shared_ptr( + new opentelemetry::metrics::NoopMeterProvider()); + return noopProvider->GetMeter(std::string(name), std::string(kMeterVersion)); + } + opentelemetry::nostd::shared_ptr startSpan(std::string_view name, opentelemetry::trace::SpanKind kind) override {