Building from Source
Overview
Section titled “Overview”BlazeBee is built using the standard Rust toolchain and relies on Cargo feature flags to control enabled collectors, transport implementations, and binary footprint. This allows producing binaries tailored for constrained edge devices, standard servers, or full-featured monitoring nodes.
This page documents all supported build paths and feature combinations.
Prerequisites
Section titled “Prerequisites”Required
Section titled “Required”-
Rust toolchain (stable)
Installed viarustup. The project targets the stable channel and does not require nightly features. -
Cargo
Comes bundled with Rust. Used for dependency resolution, feature management, and builds. -
Git
Required to clone the repository.
Optional
Section titled “Optional”- Docker
Required only for containerized builds using the providedMakefile.
Repository Layout (Build-Relevant)
Section titled “Repository Layout (Build-Relevant)”Cargo.toml— defines features, dependencies, and build profilessrc/— core application and collectorscollectors/— metric collectors grouped by feature setsDockerfile— multi-stage build for minimal runtime imagesMakefile— wrapper for Docker builds and feature presets
Building the Binary
Section titled “Building the Binary”Clone the Repository
Section titled “Clone the Repository”git clone https://github.com/rubtsov-stan/blazebee.gitcd blazebeeStandard Cargo Build
Section titled “Standard Cargo Build”cargo build --release --features <FEATURES>The resulting binary is located at:
target/release/blazebeeThe --release flag enables compiler optimizations and should be used for all production builds.
Feature Flags
Section titled “Feature Flags”BlazeBee relies heavily on Cargo features to control compilation. Features are explicit and additive.
Transport Features
Section titled “Transport Features”| Feature | Description |
|---|---|
blazebee-mqtt-v3 | Enables MQTT v3 transport using rumqttc |
Exactly one transport feature must be enabled.
Preset Feature Groups
Section titled “Preset Feature Groups”Preset features enable predefined sets of collectors and dependencies.
minimal
Section titled “minimal”- Core runtime
- Basic system metrics (CPU, memory, uptime)
- Lowest binary size
- Intended for edge devices and constrained environments
cargo build --release --features "blazebee-mqtt-v3 minimal"standard
Section titled “standard”- Default recommended configuration
- CPU, memory, disk, network, load, processes
- Balanced coverage and resource usage
cargo build --release --features "blazebee-mqtt-v3 standard"- All available collectors
- Includes advanced and kernel-level metrics
- Highest binary size and permissions requirements
cargo build --release --features "blazebee-mqtt-v3 large"Notes on Features
Section titled “Notes on Features”-
Presets internally enable multiple collector-specific flags.
-
Feature sets are resolved at compile time; unused collectors are not included in the binary.
-
Some collectors in
largemay require:- Linux-only environments
- Access to
/proc,/sys - Elevated privileges
Custom Feature Combinations
Section titled “Custom Feature Combinations”You may define custom builds by explicitly listing features:
cargo build --release --features "blazebee-mqtt-v3 cpu ram disk network"This approach is intended for advanced use cases where preset groups are insufficient.
Docker Builds
Section titled “Docker Builds”Build Using Makefile
Section titled “Build Using Makefile”BlazeBee provides a Makefile abstraction over Docker builds.
make docker TYPE=standardSupported Docker Variants
Section titled “Supported Docker Variants”| TYPE | Description |
|---|---|
minimal | Minimal collectors, smallest image |
standard | Recommended default |
large | All collectors enabled |
Build Characteristics
Section titled “Build Characteristics”- Multi-stage Docker build
- Static or near-static release binary
- Minimal runtime image (no Rust toolchain inside container)
- Feature selection passed as build arguments
The resulting image contains only:
blazebeebinary- Required system libraries
- Default config path
/etc/blazebee/config.toml
Build Profiles
Section titled “Build Profiles”BlazeBee uses Cargo’s default release profile:
opt-level = 3- Debug symbols disabled
- Panic strategy optimized for performance
Custom profiles can be defined in Cargo.toml if needed for debugging or profiling.
Platform Support
Section titled “Platform Support”- Linux: Fully supported (primary target)
- macOS: Buildable, limited collector availability
- Windows: Not supported (collectors rely on Linux system interfaces)
Summary
Section titled “Summary”- BlazeBee is built via Cargo with explicit feature flags.
- Preset feature groups (
minimal,standard,large) cover most use cases. - Docker builds are reproducible and optimized for deployment.
- Feature selection directly impacts binary size, permissions, and runtime behavior.
This build system enables precise control over functionality without runtime overhead.