Skip to main content

init

Function init 

Source
pub fn init(
    opts: &TelemetryOptions,
    staking_key: &SignKey,
    node_name: Option<&str>,
    company_name: Option<&str>,
    endpoint: &Url,
    registry: Option<Arc<Registry>>,
) -> Result<(Option<TelemetryHandle>, Vec<String>)>
Expand description

Initialize the OTel logger pipeline and, when registry is Some, spawn the metrics push immediately. Production passes None (the Registry isn’t built yet) and later calls TelemetryHandle::attach_metrics_push; tests pass it directly.

Ok((None, _)) when telemetry is disabled; Err on misconfig (bad endpoint, JWT mint failure). The returned warnings are produced before any subscriber is installed; callers MUST replay them via tracing::warn! afterward or they are lost.