Skip to main content

Crate hermod

Crate hermod 

Source
Expand description

hermod — Rust implementation of the Cardano trace-forward protocol

This crate provides two things:

  1. A forwarder library — embed in your Cardano node or any Rust application to ship traces to a running hermod-tracer instance via the Ouroboros Network mux protocol.

  2. A full tracer server (server) — run as the hermod-tracer binary to accept trace connections, write log files, serve Prometheus metrics, and optionally re-forward to a downstream collector. The server reads a Haskell-compatible YAML config, so existing cardano-tracer config files work unchanged.

§Quick start — forwarding traces from your application

use hermod::forwarder::{ForwarderAddress, ForwarderConfig, TraceForwarder};
use hermod::tracer::TracerBuilder;
use std::path::PathBuf;
use tracing_subscriber::prelude::*;

#[tokio::main]
async fn main() {
    let config = ForwarderConfig {
        address: ForwarderAddress::Unix(PathBuf::from("/tmp/hermod-tracer.sock")),
        network_magic: 764824073, // mainnet
        ..Default::default()
    };
    let forwarder = TraceForwarder::new(config);

    // Build and plug into tracing-subscriber (also spawns forwarder)
    let (layer, _fwd) = TracerBuilder::new(forwarder).build();
    tracing_subscriber::registry().with(layer).init();

    tracing::info!("Hello from hermod!");
}

§Module overview

ModuleDescription
protocolWire types: TraceObject, Severity, DetailLevel and CBOR codecs
muxOuroboros Network mux layer — handshake and mini-protocol clients
forwarderAsync forwarder that ships traces to hermod-tracer
acceptorLightweight acceptor — receive traces over a socket
dispatcherRoute and filter traces to multiple backends
tracertracing-subscriber integration layer
serverFull hermod-tracer server (file logging, Prometheus, EKG, re-forwarding)

Modules§

acceptor
Trace acceptor — listener side of the trace-forward protocol
dispatcher
hermod::dispatcher — namespace-based trace routing layer
forwarder
Trace forwarder client implementation
mux
Multiplexer-aware trace-forward protocol implementation
protocol
Trace-forward protocol implementation
server
Full hermod-tracer server implementation
tracer
High-level tracing integration for hermod

Constants§

VERSION
Library version