W Watchflare docs
Cette page n'est pas encore disponible en français. Vous lisez la version anglaise.

Configuration reference

All fields in the Watchflare agent TOML configuration file.

The agent is configured via a TOML file written at registration. You rarely need to edit it manually — most fields are set by the register command. The file is reloaded on service restart.

PlatformPath
Linux/etc/watchflare/agent.conf
macOS (Apple Silicon)/opt/homebrew/etc/watchflare/agent.conf
macOS (Intel)/usr/local/etc/watchflare/agent.conf

Warning

agent.conf contains agent_key — treat it like a password. The file is mode 0640 (root:watchflare on Linux). Never expose its contents.


Full example

agent.conf toml
# Hub connection
server_host = "hub.example.com"
server_port = "50051"

# Credentials (written at registration — do not edit manually)
agent_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
agent_key = "base64encodedkey..."

# TLS
ca_cert_file = "/etc/watchflare/ca.pem"
server_name  = "watchflare"

# Collection intervals
heartbeat_interval = 5    # seconds
metrics_interval   = 30   # seconds

# Write-Ahead Log
wal_enabled    = true
wal_path       = "/var/lib/watchflare/metrics.wal"
wal_max_size_mb = 10

# Logging
log_file  = "/var/log/watchflare-agent.log"
log_level = "info"

# Container metrics (opt-in)
container_metrics = false

Fields

Connection

FieldTypeDefaultDescription
server_hoststringHub hostname or IP address
server_portstring"50051"Hub gRPC port

Credentials

These fields are written automatically by register. Do not edit them.

FieldTypeDescription
agent_idstringUUID assigned by the Hub at registration
agent_keystringHMAC key used to sign gRPC requests

TLS

FieldTypeDefaultDescription
ca_cert_filestringPath to the Hub’s CA certificate, written at registration
server_namestringServer name for TLS certificate validation. Written at registration from the Hub response. Must match the certificate CN.

Collection intervals

FieldTypeDefaultDescription
heartbeat_intervalint5Seconds between heartbeat pings
metrics_intervalint30Seconds between metrics collection and send

Write-Ahead Log

FieldTypeDefaultDescription
wal_enabledbooltrueEnable local buffering of metrics when the Hub is unreachable
wal_pathstring{data_dir}/metrics.walWAL file path
wal_max_size_mbint10Maximum WAL size in MB. Older records are dropped (FIFO) when the limit is reached.

Logging

FieldTypeDefaultDescription
log_filestring""Log file path. Empty means stdout (captured by the service manager).
log_levelstring"info"Log verbosity: debug, info, warn, error. Override at runtime with WATCHFLARE_DEBUG=1.

Container metrics

FieldTypeDefaultDescription
container_metricsboolfalseEnable Docker container metrics. Requires the watchflare user to be in the docker group. See Docker container metrics.

Environment variables

Four environment variables can override default paths and behavior. They are used internally by the Homebrew service wrapper on macOS and generally do not need to be set manually.

VariableDescription
WATCHFLARE_CONFIG_DIROverride the config directory (/etc/watchflare on Linux)
WATCHFLARE_DATA_DIROverride the data directory (/var/lib/watchflare on Linux)
WATCHFLARE_LOG_FILEOverride the log file path
WATCHFLARE_DEBUGSet to 1 to force debug log level, regardless of log_level