Configuration Reference
This section provides detailed reference documentation for all Mermin configuration options, from network interface discovery to export settings.
How Configuration Works
Mermin uses a layered configuration approach:
Configuration File (HCL/YAML): The primary method for detailed configuration.
Environment Variables: Override global options at runtime.
Command-Line Flags: Override global options at runtime.
Global options (documented below) are the only settings configurable via all three methods. All other configuration blocks require a configuration file.
Configure Global Agent Options
Global options are top-level configuration settings that control Mermin's overall behavior. These are the only options that can be configured via CLI flags or environment variables in addition to the configuration file.
Configuration Methods
Configuration File (HCL)
# config.hcl
log_level = "info"
auto_reload = true
shutdown_timeout = "10s"Command-Line Flags
Environment Variables
Configuration Options
config / MERMIN_CONFIG_PATH
config / MERMIN_CONFIG_PATHType: String (file path) Default: None (optional) CLI Flag: --config Environment: MERMIN_CONFIG_PATH
Path to the HCL or YAML configuration file. Omit to use built-in defaults.
Example:
auto_reload / MERMIN_CONFIG_AUTO_RELOAD
auto_reload / MERMIN_CONFIG_AUTO_RELOADCurrently, this features is not supported.
Type: Boolean Default: false CLI Flag: --auto-reload Environment: MERMIN_CONFIG_AUTO_RELOAD
Automatically reload configuration when the file changes. When enabled, Mermin watches the config file and reloads it without requiring a restart.
HCL:
CLI:
Environment:
Behavior:
File is monitored for changes using filesystem watches
Configuration is reloaded atomically
Brief pause in flow capture during reload (~100ms)
Invalid configuration prevents reload (old config remains active)
Logs indicate successful/failed reload attempts
Use Cases:
Development and testing: Iterate quickly without restarts
Production: Update configuration without downtime
Debugging: Temporarily change log levels or filters
Some configuration changes may require a full restart, such as changing monitored network interfaces or modifying RBAC permissions.
log_level / MERMIN_LOG_LEVEL
log_level / MERMIN_LOG_LEVELType: String (enum) Default: info CLI Flag: --log-level Environment: MERMIN_LOG_LEVEL
Sets the logging verbosity level.
Valid Values:
trace: Most verbose, includes all debug informationdebug: Detailed debugging informationinfo: General informational messages (default)warn: Warning messages onlyerror: Error messages only
HCL:
CLI:
Environment:
Recommendations:
Production:
infoorwarnto reduce log volumeDebugging:
debugfor detailed troubleshootingDevelopment:
tracefor comprehensive visibility
shutdown_timeout
shutdown_timeoutType: Duration Default: 5s CLI Flag: Not available Environment: Not available
Maximum time to wait for graceful shutdown before forcing termination.
HCL:
Behavior: During shutdown, Mermin:
Stops accepting new packets
Waits for in-flight flows to export (up to
shutdown_timeout)Closes OTLP connections gracefully
Forces shutdown if timeout is exceeded
Recommendations:
Production:
10sto ensure flows are exportedDevelopment:
5s(default) is usually sufficientHigh-throughput: Increase to
30sor more
Related Settings:
export.otlp.max_export_timeout: Should be less thanshutdown_timeout
Monitoring Shutdown Behavior
Mermin provides metrics to monitor shutdown behavior:
Shutdown Metrics
shutdown_duration_seconds: Histogram of actual shutdown durationsshutdown_timeouts_total: Count of shutdowns that exceeded timeoutshutdown_flows_total{status="preserved"}: Flows successfully exported during shutdownshutdown_flows_total{status="lost"}: Flows lost due to shutdown timeout
Next Steps
Configure Network Interfaces: Select which interfaces to monitor
Set Up OTLP Export: Send flows to your backend
Tune Flow Generation: Configure timeouts and thresholds
Configure Health Checks: Readiness and liveness probes
Expose Prometheus Metrics: Enable scraping
Review Complete Configurations: Production-ready examples
Last updated