mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 23:38:08 +00:00
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.
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user