| Crates.io | netgauze-collector |
| lib.rs | netgauze-collector |
| version | 0.9.0 |
| created_at | 2025-03-18 16:47:18.684086+00 |
| updated_at | 2026-01-19 10:43:23.32615+00 |
| description | Network metrics collector |
| homepage | https://github.com/NetGauze/NetGauze |
| repository | https://github.com/NetGauze/NetGauze |
| max_upload_size | |
| id | 1596845 |
| size | 908,096 |
Work in progress for telemetry collection. Currently supports:
With publisher towards Kafka and HTTP endpoints.
# Run with a config file
cargo run -p netgauze-collector -- /path/to/config.yaml
The collector uses tracing with EnvFilter for flexible log level control.
Set the default log level in your config.yaml:
logging:
level: "info" # Valid: trace, debug, info, warn, error
RUST_LOGOverride the log level at runtime using the RUST_LOG environment variable:
# Set global log level
RUST_LOG=debug cargo run -p netgauze-collector -- config.yaml
# Filter specific modules
RUST_LOG=netgauze_collector=trace,tokio=info cargo run -p netgauze-collector -- config.yaml
# Complex filtering (enable trace for flow, debug for UDP notif)
RUST_LOG="warn,netgauze_collector::flow=trace,netgauze_collector::yang_push=debug" \
cargo run -p netgauze-collector -- config.yaml
The EnvFilter supports powerful filtering directives:
debug - Set global level to debugmy_crate=trace - Enable trace logs for specific cratemy_crate::module=info - Enable info logs for specific module[span_name]=debug - Enable debug logs within specific span[{field_name}]=trace - Enable trace logs for events/spans with specific fieldwarn,tokio::net=debug - Global warn, but debug for tokio::netRUST_LOG environment variable (highest priority)logging.levelNote: Invalid log levels or EnvFilters file will cause the collector to exit immediately with a clear error message.
The collector exports OpenTelemetry metrics via OTLP/gRPC:
telemetry:
id: "collector-01"
host: "localhost"
port: 4317
exporter_timeout: "10s"
reader_interval: "30s"
Metrics include:
The collector handles Ctrl+C (SIGINT) gracefully:
See example configuration files in collector crate root.
Key configuration sections:
logging: Log level configurationruntime: Tokio runtime settings (thread count)telemetry: OpenTelemetry exporter settingsflow: IPFIX/NetFlow v9 collection and publishingudp_notif: UDP Notification collection and publishingThe collector uses jemalloc for better memory efficiency on Linux (via tikv-jemallocator).
On startup, the collector logs:
This is powered by the shadow-rs crate.