1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! 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
//!
//! ```no_run
//! 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) |
/// Library version
pub const VERSION: &str = env!;