about / v0.10.42

About glances-rs.

Background, architecture and history of the pure-standard-library Rust port of Glances.

01What is Glances?

Glances is a cross-platform system monitor written in Python by Nicolas Hennion (a.k.a. Nicolargo) and a long list of contributors. It surfaces CPU, memory, swap, load, network, disk, sensors, filesystem, processes, alerts, logs and Docker container metrics from a single curses TUI, an embedded browser UI served over HTTP, or one of two dozen remote exporters. Glances is the kind of tool you keep one terminal pane wide on every box you care about.

Python Glances is mature, popular and battle-tested. glances-rs is not a replacement — it is a reimplementation in Rust with stricter dependency guarantees. All credit for the original architecture, plugin model, and CLI surface belongs to Nicolas Hennion (Nicolargo) and the upstream contributors; the port preserves the LGPL-3.0 terms.

02Why a Rust port?

Python Glances has a healthy runtime footprint — an interpreter, a web framework, an XML-RPC stack, a dozen exporter libraries, plugin discovery via filesystem walks. That is a lot of moving parts to install on a minimal container image, and a lot of transitive supply-chain to audit when a CVE lands.

Rust lets us keep the same architectural surface area — plugins, REST API, server, CLI — while collapsing the entire dependency graph to a handful of libc calls. The binary that comes out of cargo build --release is a single stripped executable with no libpython, no site-packages, no pip, and no .cargo/registry.

03Architecture

The crate is std-only: no [dependencies] in Cargo.toml, no extern crate statements, no third-party build scripts. The crate surface is split into:

Layout at a glance:

glances-rs/
├── Cargo.toml         no [dependencies]
├── src/
│   ├── main.rs        CLI dispatch; binary entry
│   ├── lib.rs         re-exports for integration tests
│   ├── cli/           hand-written parser
│   ├── core/          Value, Plugin, Stats, ...
│   ├── platform/
│   │   └── linux/     /proc + /sys readers (pure std, Linux-only)
│   ├── plugins/       one file per plugin (35 registered)
│   ├── outputs/       stdout CSV / JSON / api_doc
│   ├── server/        HTTP/1.1 + SSE + auth
│   └── qa/            tests + lint
└── qa/
    ├── lint/          no_crates, line_cap, unsafe_allowlist, no_shell
    ├── unit/          per-module tests
    ├── integration/   end-to-end smoke
    ├── edge/          malformed inputs, panic isolation
    └── fixtures/      sample /proc + /sys captures

Three hard constraints are enforced by lint, not by convention:

04Zero trust

The monitor is read-only, but it listens on ports and parses input. What it distrusts, and what it does about it:

05Tested on

macOS and Windows support was removed in v0.9.0 because the maintainer does not have hardware to test FFI on. The build refuses non-Linux targets with a compile_error! assertion.

06Project history

Full per-release notes in CHANGELOG.md.