Merge branch 'pratik/otel-phase10-workload-validation' into pratik/otel-sync-diagnostics

This commit is contained in:
Pratik Mankawde
2026-08-20 16:52:45 +01:00
19 changed files with 776 additions and 137 deletions

View File

@@ -30,6 +30,29 @@ public:
virtual ~Collector() = 0;
/**
* Called once the services that hook handlers read are constructed.
*
* Implementations that poll their producers must not do so before this:
* hook handlers read live application state. Default is a no-op, for
* collectors that only push.
*/
virtual void
onCollectionReady()
{
}
/**
* Called before those services are shut down.
*
* Polling must have stopped by the time this returns. Paired with
* onCollectionReady().
*/
virtual void
onCollectionStopping()
{
}
/**
* Create a hook.
*

View File

@@ -16,6 +16,7 @@
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <unordered_set>
#include <utility>
@@ -88,6 +89,19 @@ addValidatorManifest(soci::session& session, std::string const& serialized);
void
clearNodeIdentity(soci::session& session);
/**
* Returns this node's stored keypair, if the database holds a valid one.
*
* Read-only: unlike getNodeIdentity(), never generates or persists a key. A row
* counts only when its public and secret keys are a pair.
*
* @param session Session with the database.
*
* @return The stored keypair, or std::nullopt.
*/
std::optional<std::pair<PublicKey, SecretKey>>
readNodeIdentity(soci::session& session);
/**
* Returns a stable public and private key for this node.
*

View File

@@ -463,8 +463,10 @@ public:
/**
* Create a Telemetry instance.
*
* Returns a TelemetryImpl when setup.enabled is true, or a
* NullTelemetry no-op stub otherwise.
* With XRPL_ENABLE_TELEMETRY defined, returns a TelemetryImpl when
* setup.enabled is true, or a no-op stub otherwise. Without it, the only
* definition of this factory always returns the no-op stub and never reads
* setup.enabled.
*
* @param setup Configuration from the [telemetry] config section.
* @param journal Journal for log output during initialization.
@@ -481,6 +483,14 @@ makeTelemetry(Telemetry::Setup const& setup, beast::Journal journal);
* @param networkId Network identifier from [network_id] config
* (0 = mainnet, 1 = testnet, 2 = devnet).
* @return A populated Setup struct with defaults for missing values.
* @throws std::runtime_error If `enabled` is set and the mutual TLS (mTLS)
* settings contradict each other: only one of `tls_client_cert`/`tls_client_key`
* is given, or a client certificate is given while `use_tls` is 0. Those two
* checks are skipped when `enabled` is 0.
* @throws boost::bad_lexical_cast If any numeric key (`enabled`, `use_tls`,
* `batch_size`, the trace switches, ...) holds a value Section::valueOr cannot
* convert. None of the numeric reads sit inside the `enabled` branch, so this
* escapes whether telemetry is on or off.
*/
Telemetry::Setup
makeTelemetrySetup(