Configuration Guide
Purpose of This Page
Section titled “Purpose of This Page”Details BlazeBee settings.
BlazeBee configuration is performed via a TOML file (config.toml). Use the provided config.example.toml as the reference. By default BlazeBee loads configuration from /etc/blazebee/config.toml or from a path set in the environment variable BLAZEBEE_CONFIG.
1. Logging Configuration
Section titled “1. Logging Configuration”[logger]level = "trace" # Global log level: trace, debug, info, warn, errortimestamp_format = "Unix" # Format of timestamps in logs
[logger.console]enabled = true # Enable logging to consoleformat = "compact" # Format: compact, pretty, jsonshow_target = false # Include module pathshow_thread_ids = falseshow_spans = falseansi_colors = true # Enable ANSI colors
[logger.journald]enabled = false # Enable systemd journal loggingidentifier = "blazebee" # Journal identifierlogger.level: Controls verbosity. Useinfofor standard operation,debugfor detailed output,tracefor full tracing.logger.console.*: Options for console output formatting.logger.journald: Systemd journal integration; enable only on systems with systemd.(GitHub)
2. Transport (MQTT) Configuration
Section titled “2. Transport (MQTT) Configuration”[transport]host = "localhost" # MQTT broker addressport = 1883 # MQTT broker portclient_id = "blazebee-${HOSTNAME}" # Client ID; can use environment variableskeep_alive = 60 # Keep-alive interval in secondsclean_session = false # MQTT clean session flag
[transport.serialization]format = "json" # Message serialization format
[transport.framing]enabled = true # Enable message framingtransport.host/transport.port: Address and port of the MQTT broker.transport.client_id: Unique identifier for the MQTT client; typically includes the host name.keep_alive: Interval at which the MQTT keep-alive ping is sent.clean_session: Set tofalseto retain subscriptions across restarts.- TLS and authentication can be configured but are commented out by default. Uncomment and set
tls,username, andpasswordfields for secured connections.(GitHub)
3. Metrics Collection and Publishing
Section titled “3. Metrics Collection and Publishing”[metrics]collection_interval = 5 # Frequency (seconds) to collect metricscollection_interval: Interval to trigger metric collection.
4. Enabled Collectors
Section titled “4. Enabled Collectors”Metrics collectors are specified under [[metrics.collectors.enabled]]. Each collector entry includes:
name: Identifier of the metric collector.metadata.topic: MQTT topic where metrics are published.metadata.qos: MQTT Quality of Service (0, 1, 2).metadata.retain: MQTT retain flag for published messages.
Example:
[[metrics.collectors.enabled]]name = "cpu"[metrics.collectors.enabled.metadata]topic = "metrics/cpu"qos = 0retain = true
[[metrics.collectors.enabled]]name = "ram"[metrics.collectors.enabled.metadata]topic = "metrics/ram"qos = 0retain = true- Define one
[[metrics.collectors.enabled]]block per metric. - Typical core collectors:
cpu,ram,disk,network,processes,uptime,load_average,vmstat. - Advanced collectors (often in “large” build):
pressure,thermal,hwmon,entropy,filefd,schedstat,filesystem,systemd,power,edac,mdraid. - To disable a collector, remove its block from the configuration.(GitHub)
5. Example Collector Block
Section titled “5. Example Collector Block”[[metrics.collectors.enabled]]name = "network"[metrics.collectors.enabled.metadata]topic = "metrics/network"qos = 0retain = true- This block enables network metrics, publishing to the
metrics/networktopic. - Set
retain = trueif latest metric must persist on broker for clients that connect later.(GitHub)
6. Environment Variables
Section titled “6. Environment Variables”- BlazeBee reads configuration from the file indicated by the
BLAZEBEE_CONFIGenvironment variable. - MQTT credentials and other sensitive values can be injected using environment variables in the config (for example
${HOSTNAME},${MQTT_PASSWORD}) to avoid plaintext secrets in TOML.(GitHub)
7. Deployment Notes
Section titled “7. Deployment Notes”- Place the final configuration at
/etc/blazebee/config.tomlfor packaged or container-based deployments. - For Docker, mount the file into the container and set
BLAZEBEE_CONFIGaccordingly. - Ensure logging settings match the intended runtime environment (console or journald).
- Adjust collection and refresh intervals based on infrastructure scale and metric granularity requirements.(GitHub)
This configuration guide reflects the structure and defaults of the config.example.toml file in the rubtsov-stan/blazebee repository.(GitHub)