From e8bb4f4657f6ce87e036e775a939d3dde9a81843 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 22 Sep 2026 20:29:17 +0100 Subject: [PATCH] fix(telemetry): Catch a non-std exception from the metrics pipeline setup The startup path caught std::exception only. initMetrics() reaches the OTel SDK, which can throw something outside that hierarchy, and escaping a member initializer would stop the node starting. The section states the rule it must not break: a telemetry failure never stops the node, the global provider stays a no-op and every instrument call remains valid. The new clause drops the half-built provider and logs, exactly as the std::exception clause does. ~ApplicationImp() already carries the same pairing for the same reason. --- src/libxrpl/telemetry/Telemetry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libxrpl/telemetry/Telemetry.cpp b/src/libxrpl/telemetry/Telemetry.cpp index 97ecf11b4d..a667e57601 100644 --- a/src/libxrpl/telemetry/Telemetry.cpp +++ b/src/libxrpl/telemetry/Telemetry.cpp @@ -477,6 +477,16 @@ public: "continuing without metrics: " << e.what(); } + catch (...) + { + // initMetrics() reaches third-party SDK code, which may throw + // something outside std::exception. Escaping a constructor on the + // startup path would stop the node starting, so drop the + // half-built provider exactly as the clause above does. + meterProvider_.reset(); + JLOG(journal_.error()) << "Telemetry metrics pipeline failed to initialise, " + "continuing without metrics: unknown exception"; + } } /**