Observability
ferrixd exposes three windows into a running server: Prometheus metrics, structured tracing logs (human-readable or JSON), and the ferrixd check validator for catching problems before they're running problems. For a live look without any of that, there is ferrixd ctl status and the admin dashboard.
Prometheus metrics
Enable the endpoint in the config:
[metrics]
bind = "127.0.0.1:9090"Scrape http://127.0.0.1:9090/metrics — standard text exposition format, no dependencies, no auth (so bind to loopback or a private interface and let your Prometheus reach it there).
# prometheus.yml
scrape_configs:
- job_name: ferrixd
static_configs:
- targets: ["127.0.0.1:9090"]What you get (full catalogue with types: Metrics reference):
| Metric | Watch it for |
|---|---|
ferrixd_clients | current population; drops = netsplit or mass disconnect |
ferrixd_channels | channel count |
ferrixd_connections_total | accept rate; spikes = connect flood |
ferrixd_commands_total / ferrixd_messages_total | traffic shape |
ferrixd_sendq_drops_total | clients too slow to drain their queue |
ferrixd_flood_disconnects_total | rate-limit kills — abuse or a broken bot |
ferrixd_registration_timeouts_total | connect-and-stall behavior, port scans |
ferrixd_command_duration_seconds | per-command handler latency (histogram, command label) |
ferrixd_tls_cert_not_after_seconds | certificate expiry — alert well before it (renewal broken?) |
ferrixd_plugin_traps_total | a plugin that traps has stopped enforcing its policy (fail-open) |
ferrixd_dnsbl_*_total | blocklist lookups, hits, timeouts and skips per zone |
The three …_total disconnect counters map one-to-one to the DoS controls: SendQ overflow, token bucket exhaustion ("Excess Flood"), and registration timeout. A healthy server shows them near zero; a server under attack shows you which control is absorbing it.
Alerting ideas
# Sudden loss of >20% of clients in 5m (netsplit / crash-loop upstream)
- alert: FerrixdPopulationDrop
expr: ferrixd_clients < 0.8 * max_over_time(ferrixd_clients[15m])
for: 5m
# Sustained flood kills
- alert: FerrixdFloodKills
expr: rate(ferrixd_flood_disconnects_total[5m]) > 1
for: 10m
# Certificate expires within 14 days (renewal failing)
- alert: FerrixdCertExpiring
expr: ferrixd_tls_cert_not_after_seconds - time() < 14 * 86400
# A plugin is trapping (and therefore no longer enforcing anything)
- alert: FerrixdPluginTraps
expr: increase(ferrixd_plugin_traps_total[10m]) > 0Logging & tracing
ferrixd logs through tracing with per-connection spans: every log line produced while handling a connection carries that connection's context (remote address, nick once registered), so one misbehaving client can be followed through the log without grepping for guesses.
Control verbosity with the standard RUST_LOG grammar, either via the environment or the CLI (the flag wins) — or change it on a running server without a restart: ferrixd ctl log-level "info,ferrixd::link=debug".
ferrixd --log info
ferrixd --log debug # verbose: per-command detail
ferrixd --log "info,ferrixd::link=debug" # module-targeted: debug S2S onlyFormat and color:
ferrixd --log-format pretty # human-friendly multi-line (development)
ferrixd --log-format compact # terse single lines
ferrixd --log-format full # default
ferrixd --log-format json # one JSON object per line, for log pipelines
ferrixd --color never # for log shippers that dislike ANSIThe same defaults can live in the config file, so a container or unit file needs no flags (the flags still win):
[logging]
format = "json"
filter = "info,ferrixd::link=debug"JSON logs
json writes exactly one object per line to stdout — the startup banner is replaced by a server.start event so the stream stays machine-readable. Event fields are flattened to the top level next to timestamp, level, message and target:
{"timestamp":"2026-12-01T14:15:54.88Z","level":"INFO","message":"S2S link established","event":"link.up","peer":"hub.example","sid":"1AB","protocol":"ferrix","target":"ferrixd::link"}Key events carry a stable event field, so a pipeline can match on it instead of on the human-readable message (which may be reworded):
event | Level | Fields |
|---|---|---|
server.start | info | version, server, network, sid, tls_bind, dev |
server.shutdown | info | cause (sigint, sigterm, die, restart) |
server.restart / server.reexec | warn / info | oper / exe |
nick.forced | info | peer, old, new, reason |
control.command / control.denied | info / warn | cmd, args (passwords redacted) |
server.drain | warn | grace_secs |
multiclient.attach / multiclient.detached / multiclient.expired | info | peer, nick, connections / nick / count |
account.registered / account.verified / account.dropped | info | account (peer, verified on registration) |
account.verification_failed | warn | account, err |
account.expired | info | count |
account.oper_change | info | oper, account, change |
service.up / service.rejected | info / warn | peer, service, distribution |
connection.accepted | debug | peer |
connection.rejected | info/debug | peer, cause (dline, kline, per_ip_limit, dnsbl), reason |
connection.closed | info | peer, elapsed, reason |
oper.up / oper.failed | info / warn | oper, mask |
rehash | info / warn | oper, ok, err |
tls.reload | info | cause (file_change when the watcher installed it), cert |
tls.reload_failed | warn | cert, err |
tls.acme_issued / tls.acme_failed / tls.acme_placeholder | info / warn / warn | domains / err, retry_secs |
link.up / link.down | info | peer, sid, protocol |
plugin.trap | warn | plugin, err |
plugin.action | warn | plugin, action (gline/connect/squit), detail, outcome |
plugin.revoked / plugin.refused | warn / error | plugin, capability / err |
plugin.bot_up / plugin.bot_down | info | plugin, nick / reason |
These names are part of the 1.x stability promise; new events and fields may be added.
Under systemd, plain stdout logging lands in the journal:
journalctl -u ferrixd -fNotable events at info and above include listener startup, S2S link establishment/loss (with peer names), plugin loads and traps, OPER attempts, K/D-line hits, and every disconnect with its reason.
ferrixd check — the third pillar
Observability starts before startup. check loads the config and builds the TLS material, then prints a colorized summary of exactly what a run would start: listeners, limits, accounts/operators/bans counts, persistence, metrics, links, plugins.
ferrixd -c /etc/ferrixd/ferrixd.toml checkNon-zero exit on any problem — put it in CI and in your deploy pipeline, and REHASH (or restart) only after it passes.
Correlating the three
A worked example — "users complain about disconnects":
- Metrics:
rate(ferrixd_sendq_drops_total[5m])is climbing → clients aren't draining their queues. - Logs: filter for
SendQ exceeded— the spans name the nicks and IPs; it's one bouncer host with a saturated uplink. - Config: decide — raise
sendq_linesfor legitimate slow consumers, or let the control do its job.
Every disconnect reason a control produces (SendQ exceeded, Excess Flood, Registration timeout, Ping timeout, K-line reasons) is both a log line and, for the first three, a metric increment — the two views always agree.