Expand description
hermod — Rust implementation of the Cardano trace-forward protocol
This crate provides two things:
-
A forwarder library — embed in your Cardano node or any Rust application to ship traces to a running
hermod-tracerinstance via the Ouroboros Network mux protocol. -
A full tracer server (
server) — run as thehermod-tracerbinary 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 existingcardano-tracerconfig 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
| Module | Description |
|---|---|
protocol | Wire types: TraceObject, Severity, DetailLevel and CBOR codecs |
mux | Ouroboros Network mux layer — handshake and mini-protocol clients |
forwarder | Async forwarder that ships traces to hermod-tracer |
acceptor | Lightweight acceptor — receive traces over a socket |
dispatcher | Route and filter traces to multiple backends |
tracer | tracing-subscriber integration layer |
server | Full 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-tracerserver implementation - tracer
- High-level tracing integration for hermod
Constants§
- VERSION
- Library version