Skip to main content

Crate dpdk_telemetry

Crate dpdk_telemetry 

Source
Expand description

§dpdk-telemetry

A Rust client library for reading DPDK application telemetry via Unix socket. No DPDK headers or shared libraries required — just filesystem access to the telemetry socket (typically /var/run/dpdk/rte/dpdk_telemetry.v2).

§Quick start

use dpdk_telemetry::{TelemetrySocket, discovery, protocol};

// Auto-discover running DPDK instances
let sockets = discovery::discover_sockets().unwrap();

// Connect to the first one
let mut sock = TelemetrySocket::connect(&sockets[0]).unwrap();

// List ports
let port_ids = protocol::parse_ethdev_list(&sock.request("/ethdev/list").unwrap()).unwrap();

// Get stats for port 0
let stats = protocol::parse_ethdev_stats(
    &sock.request("/ethdev/stats,0").unwrap(), 0
).unwrap();
println!("RX packets: {}", stats.ipackets);

Re-exports§

pub use socket::TelemetrySocket;

Modules§

alerts
Alert evaluation (built-in and custom rules).
discovery
Auto-detect DPDK telemetry socket paths.
history
Fixed-size ring buffer for time-series history.
model
protocol
Telemetry JSON request/response types and parsing.
rates
Delta and rate computation with optional EMA smoothing.
socket
Unix socket connection to DPDK telemetry. DPDK uses SOCK_SEQPACKET; we try seqpacket first and fall back to stream (e.g. macOS).