tracerlight 2.22.1

Install Tracerlight

Server and client in one binary. Supported on Linux, FreeBSD, OpenBSD (7.9 and 8.0) and Windows (x86_64). See also the whole-stack setup guide.

1. Download and verify

Binaries live at https://download.solidfokus.com/public/tracerlight/<platform>/. Platforms: x86_64-linux-glibc, x86_64-linux-musl, x86_64-freebsd-15-static, x86_64-freebsd-15-dynamic, x86_64-freebsd-14-static, x86_64-freebsd-14-dynamic, x86_64-openbsd-8.0, x86_64-openbsd-7.9, x86_64-unknown-windows. FreeBSD binaries are per major (15 and 14; pick the directory matching the major from uname -r). OpenBSD binaries are per release (8.0 and 7.9; pick the directory matching uname -r). Each directory holds the binary tracerlight-2.22.1-f136bd5 (tracerlight-2.22.1-f136bd5.exe on Windows) and a .sha256 file in sha256sum format (<hex digest> <file name>).

Linux

P=x86_64-linux-musl        # or x86_64-linux-glibc
curl -fLO https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5
curl -fLO https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5.sha256
sha256sum -c tracerlight-2.22.1-f136bd5.sha256

FreeBSD and OpenBSD builds depend on the OS version: run uname -r and pick the matching build (FreeBSD: the major, 15 or 14; OpenBSD: the release, 8.0 or 7.9).

FreeBSD

P=x86_64-freebsd-15-static    # or x86_64-freebsd-15-dynamic; also 14 (x86_64-freebsd-14-static / x86_64-freebsd-14-dynamic). Pick the major from uname -r.
fetch https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5 https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5.sha256
[ "$(sha256 -q tracerlight-2.22.1-f136bd5)" = "$(cut -d ' ' -f1 tracerlight-2.22.1-f136bd5.sha256)" ] && echo OK

OpenBSD

P=x86_64-openbsd-8.0          # or x86_64-openbsd-7.9; pick the directory matching uname -r
ftp https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5 https://download.solidfokus.com/public/tracerlight/$P/tracerlight-2.22.1-f136bd5.sha256
[ "$(sha256 -q tracerlight-2.22.1-f136bd5)" = "$(cut -d ' ' -f1 tracerlight-2.22.1-f136bd5.sha256)" ] && echo OK

Windows

# PowerShell
Invoke-WebRequest https://download.solidfokus.com/public/tracerlight/x86_64-unknown-windows/tracerlight-2.22.1-f136bd5.exe -OutFile tracerlight.exe
Invoke-WebRequest https://download.solidfokus.com/public/tracerlight/x86_64-unknown-windows/tracerlight-2.22.1-f136bd5.exe.sha256 -OutFile tracerlight.exe.sha256
(Get-FileHash tracerlight.exe -Algorithm SHA256).Hash.ToLower() -eq (Get-Content tracerlight.exe.sha256).Split(' ')[0]

Install

install -m 0755 tracerlight-2.22.1-f136bd5 /usr/local/bin/tracerlight     # Linux
install -m 0555 tracerlight-2.22.1-f136bd5 /usr/local/bin/tracerlight     # FreeBSD / OpenBSD
tracerlight --version

The service examples below assume /usr/local/bin/tracerlight.

Published SHA-256 digests for tracerlight 2.22.1-f136bd5:

PlatformSHA-256
x86_64-linux-glibcbb15fa61499fc5659e46ca1178a9070be8640c914b99c50347ec9a67bb662680
x86_64-linux-muslff8eace01ba3e2538bafe37d4c62ab2d028e2e180c430ea568defcc1a633d01c
x86_64-freebsd-15-dynamicb1ea912ffcbac21d1f0197f597915b831beeca93cabaf14034698b1ce6a440a3
x86_64-freebsd-15-static4b6226c1842868b9bf2bf343c8bfb5baa79dec955129ff346f9b25f3cd44b6b0
x86_64-freebsd-14-dynamic9af34ace66917c11f3f980394b31dd4d584c9ed0fa67b64ad7b4f5352b94138a
x86_64-freebsd-14-static2f91cb248af7ec93da29fbeea8cba84fe67756b721887df42a7268d039004a07
x86_64-openbsd-8.00030a3767a46b623fc7576191c6fe3c86bfd0d5fd2ce601636a426425d14519f
x86_64-openbsd-7.9189b2d9afe9d144f7abb49d0e35c1bf2a5d435512a9521b0b38ce84dc2ff2d53
x86_64-unknown-windows7edf9751f704144d48a307928d3a58a4a78f4c1dd1512444e1a1d7eb54b5bdd8

2. Generate the config template (first step)

Every SolidFokus app prints a template configuration with --config and no argument. It writes only to stdout and exits; it creates or overwrites no files. The config is needed on every client and server that sends telemetry to Gyroscopic.

Linux (the service user first, then its config directory; FreeBSD, OpenBSD and Windows: see the service section, which uses other paths and owners):

useradd --system --no-create-home --shell /usr/sbin/nologin tracerlight
install -d -m 0700 -o tracerlight -g tracerlight /etc/tracerlight
tracerlight --config > /etc/tracerlight/post-config.json
chown tracerlight:tracerlight /etc/tracerlight/post-config.json
chmod 0600 /etc/tracerlight/post-config.json

Then edit it: set url to your Gyroscopic and replace auth_secret with the real secret. The template value is a public placeholder and must never be used. Generate a strong secret, for example with openssl rand -base64 32, and use the same value on both sides.

Telemetry config fields

FieldDefaultMeaning
urlrequiredGyroscopic collect endpoint, e.g. http://stats.example.net:3000/api/v1/collect or via NGINX https://stats.example.net/api/v1/collect. An unpinned https:// url needs the OS CA store (below); a redirect from http:// to https:// is not followed.
auth_secretnoneBasic Auth password for user tracerlight; must equal Gyroscopic auth.tracerlight_secret. Omit only if Gyroscopic runs without auth.
headers{}Extra request headers sent with every POST (template sets X-Tracerlight-Source).
timeout_secs5HTTP request timeout.
max_queue_size86400Queued snapshots (24 h at 1 Hz).
initial_sleep_ms500First retry delay (exponential backoff with jitter).
max_sleep_ms64000Maximum retry delay.
tls_sha256noneFingerprint of a self-signed Gyroscopic certificate (64 hex; colons and case ignored). Needs an https:// url. Not in the template; add it. New in 2.20.0.

Pinning a self-signed Gyroscopic (2.20.0)

When Gyroscopic 1.12.0 runs with "tls": "self-signed", read its fingerprint from its start-up log or with gyroscopic --config <file> --tls-info, then set:

{
  "url": "https://192.168.1.10:3000/api/v1/collect",
  "auth_secret": "<tracerlight_secret>",
  "tls_sha256": "<64 hex from gyroscopic>"
}

With the pin, Tracerlight accepts exactly that certificate; the host name and expiry are not checked, so a name or an IP both work. The start-up log shows post tls pin sha256=<hex>. A wrong pin gives post error: … certificate fingerprint mismatch: expected <pin>, got <actual> and is retried with backoff (UDP testing continues). A pin with an http:// url, or a malformed pin, is a start-up config error. Pin self-signed certificates only; with a public certificate (Gyroscopic file mode or NGINX) leave tls_sha256 out. Without a pin, an https:// url to a self-signed Gyroscopic is rejected. After Gyroscopic's certificate is regenerated, update tls_sha256 and restart the client. If Gyroscopic has an allow list, the client's address must be on it.

Public certificates and the system CA store (2.20.2)

An https:// url without tls_sha256 (for example Gyroscopic with a public certificate, or NGINX in front) is checked against the operating system's CA store, the same roots curl uses:

OSRootsIf missing
LinuxThe distribution bundle, e.g. /etc/ssl/certs/ca-certificates.crt (Debian, Ubuntu), /etc/pki/tls/certs/ca-bundle.crt (Fedora, RHEL), /etc/ssl/cert.pem (Alpine)Install ca-certificates: apt install ca-certificates, dnf install ca-certificates or apk add ca-certificates
FreeBSD/usr/local/etc/ssl/cert.pem and /etc/ssl/certspkg install ca_root_nss, or certctl rehash to rebuild /etc/ssl/certs from the base system
OpenBSD/etc/ssl/cert.pem (base system)Restore it from the OpenBSD base set
WindowsThe Windows certificate storeKept current by Windows Update

SSL_CERT_FILE (a PEM bundle) or SSL_CERT_DIR replaces these locations for the process; an empty value counts as set and means no certificates. In a service set it with systemd Environment=, the FreeBSD <name>_env rc.conf variable, or on OpenBSD a setenv entry in the instance's login class (as for the logging level, section 5). On OpenBSD the usual fix is to restore /etc/ssl/cert.pem instead. A plain http:// url and a pinned self-signed Gyroscopic do not use the store and need no CA bundle. A private CA works once it is installed in the OS store. To add one: Debian/Ubuntu install -m 644 ca.crt /usr/local/share/ca-certificates/<name>.crt && update-ca-certificates (the file name must end in .crt); FreeBSD: copy the PEM to /usr/local/share/certs/<name>.pem, then certctl rehash. Restart the service afterwards. Tested on Ubuntu 24.04 and FreeBSD 15.1 (2026-11-26). A plain http:// url does not follow a redirect to https://; put the https:// url in the config.

Without any CA certificates, an unpinned https:// url stops at start-up with exit code 1:

Error: no CA certificates found on this host, needed to verify the unpinned https url <url>: <fix for this OS>, or set SSL_CERT_FILE to a PEM CA bundle. …

Fix as in the table, or see Troubleshooting. Before 2.20.1 the binary carried its own root list, so a host without a CA bundle worked; 2.20.1 aborted (exit 134) without a CA bundle even for http://.

Retries: transient errors back off exponentially; an HTTP 503 with Retry-After is honoured (1–3600 s); other 4xx responses drop the snapshot. On shutdown pending snapshots are drained for up to 5 s and a final snapshot is sent.

Servers send telemetry too: with --config and --tag, a server POSTs cumulative server stats (packets received and sent, invalid key, decode, receive and send errors) every interval, using the same config file and collector URL as clients. In both roles, --config without --tag stops at startup.

3. Command-line flags

From tracerlight --help (2.22.0). Note: there is no --target flag; the bind address or destination is the positional TARGET argument.

FlagDefaultMeaning
-s, --serveroffRun in server mode (UDP echo).
-k, --key <KEY>none (required)Validation key: a decimal integer from 0 to 18446744073709551615 (64-bit unsigned). Letters, hex or a minus sign fail at start with invalid digit found in string. Must be identical on client and server; mismatched packets are dropped and counted as invalid_key on the server.
[TARGET] (positional)server: 0.0.0.0; client: requiredServer: bind address. Client: server IP or hostname. IPv6 in brackets, e.g. "[::1]".
-p, --base-port9000First UDP port of the range. A client must use the server's base port; it probes that port and learns the server's full range.
-n, --num-sessions32Server: number of ports to bind, [base-port, base-port+n), for load-spreading; exits if any port fails to bind. Client: number of sessions, spread across the ports the server reports. The two -n values do not need to match.
-r, --rate32Client: packets per second per session (defaults give ~1024 pps total).
-T, --timeout1Client ringbuffer timeout in seconds; capacity per session = timeout × rate (~40 bytes per slot, capped at 2^24 slots).
-i, --interval1Stats aggregation interval in seconds.
-t, --tagnoneTag included in stats. Required with --config; then must be 1–64 chars of [A-Za-z0-9_-] or startup fails.
-o, --outputprettyStats format on stdout: pretty or json.
--log-formatprettyOperational log format on stderr: pretty or json. Level via RUST_LOG (default info).
--no-probeoffClient: skip probing the server ports at startup (probe timeout is 30 s total). Sessions then use the client's own -p/-n as the destination range, not the range the server would have reported.
--config [PATH]nonePath to the HTTP POST telemetry config. With no path: print a template to stdout and exit.
--recv-buffer / --send-bufferOS defaultUDP socket buffer sizes in bytes. Raise them at high packet rates; watch recv_error.
--duration <SECONDS>noneStop after this many seconds, print the final record, and exit 0. One-off runs only; new in 2.21.0 (see the note below the table).
--packets <N>noneClient: stop after this many successful sends across all sessions, print the final record, and exit 0; conflicts with --duration and --server. One-off runs only; new in 2.21.0 (see the note below the table).
--licensePrint license and exit.
--install-service / --uninstall-service <NAME>Windows only: install or remove a native service; see section 5.
--log-file <PATH>consoleWindows only: append stats and logs to PATH, rotated at 10 MiB, 5 kept. With --install-service, stored as an absolute path; its directory is created and granted, and must be inside %ProgramData% and not contain the .exe (2.18.3+); from 2.18.4 it must be the default %ProgramData%\solidfokus\logs or a new directory the install creates (an existing one is rejected).
-h, --help / -V, --versionHelp / version.

--duration and --packets are new in 2.21.0; older binaries reject both flags with exit 2. They are mutually exclusive one-off run limits for a single run from a shell: the client or server stops on its own, prints the existing final record and exits 0; --packets counts successful sends across all sessions, and the client waits --timeout seconds after the last send so late replies still land. They must not go into the service configurations below. FreeBSD rc.d runs the binary under daemon -r, which restarts the child about one second after any exit — including this clean exit 0 — so a finite run installed there would loop. Linux systemd uses Restart=on-failure and the Windows recovery actions restart a failure: neither restarts a clean exit 0, and the flags stay out of those configs anyway — no ExecStart, --install-service, tracerlight_<role>_args or OpenBSD rcctl set … flags line carries them.

Examples

# Server: 64 UDP ports 9000-9063 on all addresses
tracerlight --server --key <KEY> --base-port 9000 --num-sessions 64 --tag server1 --output json --log-format json --config /etc/tracerlight/post-config.json

# Client on client-a, measuring server1 and sending telemetry
tracerlight --key <KEY> server1.example.net --base-port 9000 --num-sessions 64 --rate 50 --timeout 2 \
  --tag client-a-server1 --output json --log-format json --config /etc/tracerlight/post-config.json

Replace <KEY> with a numeric key you choose (a decimal integer from 0 to 18446744073709551615 (64-bit unsigned)); use the same key on client and server. Generate one with od -An -N8 -tu8 /dev/urandom | tr -d ' ' (Linux, FreeBSD, OpenBSD) or, in PowerShell, $b = New-Object byte[] 8; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b); [BitConverter]::ToUInt64($b, 0). The examples use the same -n on both sides for simplicity; they do not have to match. A 16-session client against an 8-port server is fine: the client probes the server's -p, learns the port range from the reply, and spreads its sessions across those ports.

4. Firewall

On each server, allow inbound UDP for the whole port range from your clients (example: 9000–9063 for -p 9000 -n 64). Clients need outbound UDP to that range and, if they send telemetry, outbound TCP to Gyroscopic (3000, or 443 through NGINX).

# Linux (iptables)
iptables -A INPUT -p udp --dport 9000:9063 -j ACCEPT
# Linux (firewalld)
firewall-cmd --add-port=9000-9063/udp --permanent && firewall-cmd --reload
# FreeBSD / OpenBSD (pf) - adjust the interface
pass in on em0 proto udp from any to any port 9000:9063
# Windows (PowerShell, elevated)
New-NetFirewallRule -DisplayName "Tracerlight server UDP 9000-9063" -Direction Inbound -Protocol UDP -LocalPort 9000-9063 -Action Allow

FreeBSD: if pf is enabled, add these rules; if no firewall is running, skip this step.

OpenBSD: pf is enabled by default and blocks inbound traffic. Put the pass rule above the block line in /etc/pf.conf, replace em0 with the host's real interface, and reload with pfctl -f /etc/pf.conf.

5. Run as a service

Linux (systemd)

Tested on Ubuntu 24.04 (2026-11-25) with 2.22.0-a507b62: both units below (enable, start, stop), one server and one client posting to Gyroscopic. Not tested: start at boot.

The user tracerlight and /etc/tracerlight (owner tracerlight, 0700; config 0600) come from section 2. If you created the config before the user, fix ownership:

id tracerlight || useradd --system --no-create-home --shell /usr/sbin/nologin tracerlight
chown -R tracerlight:tracerlight /etc/tracerlight

/etc/systemd/system/tracerlight-server.service:

[Unit]
Description=Tracerlight server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=tracerlight
Group=tracerlight
ExecStart=/usr/local/bin/tracerlight --server --key <KEY> --base-port 9000 --num-sessions 64 --interval 1 --tag server1 --output json --log-format json --config /etc/tracerlight/post-config.json
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=tracerlight-server
ReadWritePaths=/etc/tracerlight
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Only for ports below 1024, add AmbientCapabilities=CAP_NET_BIND_SERVICE and CapabilityBoundingSet=CAP_NET_BIND_SERVICE. /etc/systemd/system/tracerlight-client.service is the same with:

Description=Tracerlight client -> server1
ExecStart=/usr/local/bin/tracerlight --key <KEY> server1.example.net --base-port 9000 --num-sessions 64 --rate 50 --timeout 2 --interval 1 --tag client-a-server1 --output json --log-format json --config /etc/tracerlight/post-config.json
SyslogIdentifier=tracerlight-client
ReadWritePaths=/etc/tracerlight
systemctl daemon-reload
systemctl enable --now tracerlight-server     # and/or tracerlight-client
journalctl -u tracerlight-server -f

FreeBSD (rc.d)

Two scripts with fixed names, one per role: /usr/local/etc/rc.d/tracerlight_server and /usr/local/etc/rc.d/tracerlight_client. Install only the roles a host runs; both can run on the same host. Do not use one script whose name comes from $0: at boot rc(8) sources the script, so $0 is not the script name and the service would not start.

Create the user, the config directory and the config. The app reads the config after the privilege drop, so it is owned by root:tracerlight with mode 0640 (on Linux it is 0600 and owned by the service user). pw useradd creates a same-named primary group and no home directory. The binary is installed in step 1.

pw useradd tracerlight -c "Tracerlight" -d /nonexistent -s /usr/sbin/nologin
install -d -m 0750 -o root -g tracerlight /usr/local/etc/tracerlight
tracerlight --config > /usr/local/etc/tracerlight/post-config.json
chown root:tracerlight /usr/local/etc/tracerlight/post-config.json
chmod 0640 /usr/local/etc/tracerlight/post-config.json

/usr/local/etc/rc.d/tracerlight_server (mode 0555, owner root):

#!/bin/sh
#
# PROVIDE: tracerlight_server
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# One file per role (tracerlight_server, tracerlight_client), each with a
# fixed name. Do not derive name from $0: at boot rc(8) sources the script
# (run_rc_script in /etc/rc.subr), so $0 is /etc/rc, not the script.
#
# rc.conf(5) variables:
#   tracerlight_server_enable (bool)  Default: "NO"
#   tracerlight_server_args   (str)   Tracerlight arguments. Required, no default.
#   tracerlight_server_runas  (str)   Default: tracerlight (daemon(8) -u)
#   tracerlight_server_log    (path)  Default: /var/log/solidfokus/tracerlight_server.log
#   tracerlight_server_umask  (str)   Default: 022 (rc.subr umask for daemon(8); keeps -M 0640)
#   tracerlight_server_env    (str)   No default. Passed to env(1); use it for RUST_LOG
#
# Do NOT set tracerlight_server_user. rc.subr(8) starts $command via "su -m".
# The account shell is /usr/sbin/nologin, so su execs nologin and exits.
# If the shell can run the command, daemon(8) is not root and "daemon -u"
# fails with "failed to set user environment".
# Do NOT set tracerlight_server_flags: rc.subr puts them right after $command, so
# they would be parsed by daemon(8), not by tracerlight. Arguments go in
# tracerlight_server_args.
# The script unsets both after load_rc_config and warns. A custom tracerlight_server_log is kept.
#
# daemon(8) flags:
#  -r : Restart the child one second after an unexpected exit
#  -f : Point the supervisor's stdin, stdout and stderr at /dev/null
#  -P : Write the supervisor pid (use with -r; the child pid changes)
#  -H : Reopen the output log on SIGHUP
#  -m : Send stdout and stderr to the log (mask 3: stats and operational logs)
#  -o : Append the child's output to this log file
#  -M : Mode used when the log file is created
# -M is in FreeBSD 14.5 and 15.1 and later. It is not in 13.x,
# 14.0-14.4, or 15.0; on those releases delete "-M 0640" from
# command_args and the log is created mode 0600 until newsyslog
# rotates it.
#  -u : Run the child as this user; the supervisor stays root

. /etc/rc.subr

name="tracerlight_server"
rcvar="tracerlight_server_enable"

load_rc_config $name

# rc.subr consumes these two names. Clear them so a leftover rc.conf
# line cannot start daemon(8) via su(1) or hand daemon(8) the flags.
if [ -n "${tracerlight_server_user-}" ]; then
	warn "tracerlight_server_user is ignored; rc.subr would su(1) to it and daemon -u would fail. Use tracerlight_server_runas."
	unset tracerlight_server_user
fi
if [ -n "${tracerlight_server_flags-}" ]; then
	warn "tracerlight_server_flags is ignored; rc.subr would pass it to daemon(8), not to tracerlight."
	unset tracerlight_server_flags
fi

: ${tracerlight_server_enable:="NO"}
: ${tracerlight_server_args:=""}
: ${tracerlight_server_runas:="tracerlight"}
: ${tracerlight_server_log:="/var/log/solidfokus/tracerlight_server.log"}
: ${tracerlight_server_umask:="022"}

pidfile="/var/run/${name}.pid"
procname="/usr/sbin/daemon"
command="/usr/sbin/daemon"
command_args="-r -f -P ${pidfile} -H -m 3 -o ${tracerlight_server_log} -M 0640 -u ${tracerlight_server_runas} /usr/local/bin/tracerlight ${tracerlight_server_args}"
required_files="/usr/local/bin/tracerlight"
start_precmd="${name}_prestart"

tracerlight_server_prestart()
{
	if [ -z "${tracerlight_server_args}" ]; then
		err 1 "tracerlight_server_args is not set in rc.conf"
	fi
	install -d -m 0755 -o root -g wheel "${tracerlight_server_log%/*}"
}

run_rc_command "$1"

/usr/local/etc/rc.d/tracerlight_client (mode 0555, owner root):

#!/bin/sh
#
# PROVIDE: tracerlight_client
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# One file per role (tracerlight_server, tracerlight_client), each with a
# fixed name. Do not derive name from $0: at boot rc(8) sources the script
# (run_rc_script in /etc/rc.subr), so $0 is /etc/rc, not the script.
#
# rc.conf(5) variables:
#   tracerlight_client_enable (bool)  Default: "NO"
#   tracerlight_client_args   (str)   Tracerlight arguments. Required, no default.
#   tracerlight_client_runas  (str)   Default: tracerlight (daemon(8) -u)
#   tracerlight_client_log    (path)  Default: /var/log/solidfokus/tracerlight_client.log
#   tracerlight_client_umask  (str)   Default: 022 (rc.subr umask for daemon(8); keeps -M 0640)
#   tracerlight_client_env    (str)   No default. Passed to env(1); use it for RUST_LOG
#
# Do NOT set tracerlight_client_user. rc.subr(8) starts $command via "su -m".
# The account shell is /usr/sbin/nologin, so su execs nologin and exits.
# If the shell can run the command, daemon(8) is not root and "daemon -u"
# fails with "failed to set user environment".
# Do NOT set tracerlight_client_flags: rc.subr puts them right after $command, so
# they would be parsed by daemon(8), not by tracerlight. Arguments go in
# tracerlight_client_args.
# The script unsets both after load_rc_config and warns. A custom tracerlight_client_log is kept.
#
# daemon(8) flags:
#  -r : Restart the child one second after an unexpected exit
#  -f : Point the supervisor's stdin, stdout and stderr at /dev/null
#  -P : Write the supervisor pid (use with -r; the child pid changes)
#  -H : Reopen the output log on SIGHUP
#  -m : Send stdout and stderr to the log (mask 3: stats and operational logs)
#  -o : Append the child's output to this log file
#  -M : Mode used when the log file is created
# -M is in FreeBSD 14.5 and 15.1 and later. It is not in 13.x,
# 14.0-14.4, or 15.0; on those releases delete "-M 0640" from
# command_args and the log is created mode 0600 until newsyslog
# rotates it.
#  -u : Run the child as this user; the supervisor stays root

. /etc/rc.subr

name="tracerlight_client"
rcvar="tracerlight_client_enable"

load_rc_config $name

# rc.subr consumes these two names. Clear them so a leftover rc.conf
# line cannot start daemon(8) via su(1) or hand daemon(8) the flags.
if [ -n "${tracerlight_client_user-}" ]; then
	warn "tracerlight_client_user is ignored; rc.subr would su(1) to it and daemon -u would fail. Use tracerlight_client_runas."
	unset tracerlight_client_user
fi
if [ -n "${tracerlight_client_flags-}" ]; then
	warn "tracerlight_client_flags is ignored; rc.subr would pass it to daemon(8), not to tracerlight."
	unset tracerlight_client_flags
fi

: ${tracerlight_client_enable:="NO"}
: ${tracerlight_client_args:=""}
: ${tracerlight_client_runas:="tracerlight"}
: ${tracerlight_client_log:="/var/log/solidfokus/tracerlight_client.log"}
: ${tracerlight_client_umask:="022"}

pidfile="/var/run/${name}.pid"
procname="/usr/sbin/daemon"
command="/usr/sbin/daemon"
command_args="-r -f -P ${pidfile} -H -m 3 -o ${tracerlight_client_log} -M 0640 -u ${tracerlight_client_runas} /usr/local/bin/tracerlight ${tracerlight_client_args}"
required_files="/usr/local/bin/tracerlight"
start_precmd="${name}_prestart"

tracerlight_client_prestart()
{
	if [ -z "${tracerlight_client_args}" ]; then
		err 1 "tracerlight_client_args is not set in rc.conf"
	fi
	install -d -m 0755 -o root -g wheel "${tracerlight_client_log%/*}"
}

run_rc_command "$1"

Install with install -m 0555 tracerlight_server tracerlight_client /usr/local/etc/rc.d/.

/etc/rc.conf (arguments go in _args, never _flags; _args has no default and the service refuses to start without it; --key must match on server and client):

# --- tracerlight server ---
tracerlight_server_enable="YES"
tracerlight_server_args="--server --key <KEY> --base-port 9000 --num-sessions 64 --interval 1 --tag server1 --output json --log-format json --config /usr/local/etc/tracerlight/post-config.json"
# tracerlight_server_env="RUST_LOG=info"
# --- tracerlight client ---
tracerlight_client_enable="YES"
tracerlight_client_args="--key <KEY> server1.example.net --base-port 9000 --num-sessions 64 --rate 50 --timeout 2 --interval 1 --tag client-a-server1 --output json --log-format json --config /usr/local/etc/tracerlight/post-config.json"
# tracerlight_client_env="RUST_LOG=info"

Enable and start:

sysrc tracerlight_server_enable=YES
service tracerlight_server start
service tracerlight_server status
sockstat -4 -l -P udp -p 9000      # USER column must read: tracerlight
tail -f /var/log/solidfokus/tracerlight_server.log    # stats and logs

Notes (checked against FreeBSD 15.1 rc.subr(8), rc.conf(5), su(1) and daemon(8)):

Migrating from an earlier script

Hosts that installed an earlier version of this script must migrate:

  1. Install the new script(s) over the old ones (tracerlight_server, tracerlight_client) and delete any copy installed under another name.
  2. In /etc/rc.conf, rename tracerlight_server_flags / tracerlight_client_flags to tracerlight_server_args / tracerlight_client_args (long or short options both work), and remove any tracerlight_<role>_user. The script unsets a leftover _user or _flags and warns, but the arguments are then missing until they are moved to _args.
  3. Append the 6. Logging section lines to /usr/local/etc/newsyslog.conf.d/solidfokus.conf (create the file if it is absent). Do not replace that file: Gyroscopic, Tailfin, and Tracerlight share it, and replacing it drops the other services. Remove any old tracerlight lines that name the separate .data files; those files are no longer written and can be archived. The pid file stays /var/run/tracerlight_<role>.pid.
  4. service tracerlight_server restart, then check with sockstat as above.

Side-by-side or test instance: the script hardcodes the binary path /usr/local/bin/tracerlight in command_args (the program daemon(8) starts) and in required_files, in both tracerlight_server and tracerlight_client. When you copy or rename the script for a second instance, for example to test a new version next to the running one, also change that path to the new binary; otherwise the copy runs the old binary. Check with ps -ax -o command | grep tracerlight.

OpenBSD (rc.d)

Tested on OpenBSD 7.9 and 8.0 (2026-11-26) with 2.22.0-a507b62: install, the user and config setup, both scripts with rcctl (set flags, enable, start, check), start at boot, the pf rule (section 4), the Verify checks, telemetry to a self-signed Gyroscopic with a pin (8.0) and an upgrade (8.0). Not tested: RUST_LOG through the login class. Log rotation was tested on 2026-11-27 (section 6).

Tested on OpenBSD 8.0: the server and client scripts below work verbatim with Tracerlight 2.20.0 (verified 2026-11-02; earlier also 2.18.7). Written against the current OpenBSD rc.subr(8), rcctl(8), syslogd(8), newsyslog(8) and login.conf(5) sources.

rc.subr starts the process as daemon_user through su(1); there is no root supervisor as on FreeBSD. Create the user, the config (owned root:_tracerlight mode 0640, the same rule as FreeBSD) and the log directory:

groupadd _tracerlight
useradd -c "Tracerlight Daemon" -d /nonexistent -g _tracerlight -s /sbin/nologin _tracerlight
install -d -m 0750 -o root -g _tracerlight /etc/tracerlight
tracerlight --config > /etc/tracerlight/post-config.json    # then set url and auth_secret
chown root:_tracerlight /etc/tracerlight/post-config.json
chmod 0640 /etc/tracerlight/post-config.json
install -d -m 0755 -o root -g wheel /var/log/solidfokus

Install the same script as /etc/rc.d/tracerlight_server and/or /etc/rc.d/tracerlight_client (install -m 0555). rc.subr takes the instance name from the file name:

#!/bin/ksh
#
# Instance script: install under one name per role,
#   tracerlight_server   and/or   tracerlight_client
# rc.subr sets _name from the script file name; it selects the rcctl flags
# variable (<name>_flags), the login class and the log file below.
#
# Stats (stdout) and logs (stderr) are appended to one file per instance,
# /var/log/solidfokus/<name>.log, as on FreeBSD. rc.subr runs the command
# through su(1) as daemon_user, so the shell that opens the file is
# _tracerlight: rc_pre creates the file first, owned by _tracerlight, mode 0640.
# Rotation: /etc/newsyslog.conf restarts the instance (section 6 Logging).

daemon="/usr/local/bin/tracerlight"
daemon_flags="-s -o json"
daemon_user="_tracerlight"

. /etc/rc.d/rc.subr

rc_bg=YES
rc_reload=NO

_log="/var/log/solidfokus/${_name}.log"

rc_pre() {
	install -d -m 0755 -o root -g wheel /var/log/solidfokus
	[ -f "${_log}" ] ||
		install -m 0640 -o "${daemon_user}" -g "${daemon_user}" /dev/null "${_log}"
}

rc_start() {
	rc_exec "${daemon} ${daemon_flags} >>${_log} 2>&1"
}

rc_cmd $1

How rcctl start returns for this non-forking daemon: this is the idiom OpenBSD ports use for foreground daemons (rc_bg=YES after sourcing rc.subr). rc_exec runs the command under su(1) in a shell with set -o monitor, so the daemon (and any logger pipeline) gets its own process group. A watcher polls rc_check (pgrep -xf "${pexp}") and, once the daemon is up, sends SIGALRM to that shell. The shell dies, rc_start returns 142 (counted as success), and the daemon keeps running, detached. rcctl check/stop match it by ${daemon} ${daemon_flags}. The redirection is not part of the process arguments, so it does not affect that match.

rcctl enable tracerlight_server
rcctl set tracerlight_server flags "-s -k <KEY> -p 9000 -n 64 -i 1 -t server1 -o json --log-format json --config /etc/tracerlight/post-config.json"
rcctl start tracerlight_server
rcctl check tracerlight_server
tail -f /var/log/solidfokus/tracerlight_server.log    # stats and logs
fstat -u _tracerlight | grep udp                      # sockets owned by _tracerlight

The built-in default flags lack --key and will fail; always set flags with rcctl set. rcctl writes the value unquoted into /etc/rc.conf.local and rc.subr cuts it at the first #; keep flags free of #, quotes and paths with spaces, and check the stored value with rcctl get tracerlight_server flags. For a client use tracerlight_client with client flags (target, -r, its own -t).

tracerlight_server:\
	:setenv=RUST_LOG=info:\
	:tc=daemon:

Side-by-side or test instance: the script hardcodes the binary path in daemon="/usr/local/bin/tracerlight". When you copy the script under another name for a second instance, for example to test a new version, also change daemon= to the new binary; otherwise the copy runs the old binary. Check with ps -ax -o command | grep tracerlight.

Migrating from an earlier OpenBSD script

The earlier script wrote <name>.data and <name>.log, could not create them as the service user, used ${_bg} (not defined in current rc.subr) and a newsyslog.conf.d file that OpenBSD never reads.

  1. rcctl stop tracerlight_server (and tracerlight_client).
  2. Install the new script over each instance.
  3. chown root:_tracerlight /etc/tracerlight /etc/tracerlight/post-config.json; chmod 0750 /etc/tracerlight; chmod 0640 /etc/tracerlight/post-config.json.
  4. Delete /etc/newsyslog.conf.d/tracerlight.conf and add the section 6 lines to /etc/newsyslog.conf. Old .data files can be archived.
  5. rcctl start tracerlight_server.

Windows (native service)

The Windows service support is new in 2.18.0. Client and server services have been tested on real Windows 11 with 2.18.8: install, restart actions, firewall rule, real traffic, and automatic restart after the process was killed; verified again with 2.20.0 on Windows 11 build 26200 on 2026-11-02. Also tested on Windows Server 2022 (2026-11-25) with 2.22.0-a507b62: server and client install, the icacls step after --install-service, start, and --uninstall-service (server stop with the 5 s drain took 5.1 s).

Processes started from an interactive Windows OpenSSH session are killed when the session closes; for anything that must keep running use --install-service.

The binary registers itself with the Service Control Manager; no WinSW or NSSM. The .exe links the C runtime statically, so no Visual C++ Redistributable is needed. Run everything in an elevated PowerShell.

Option (Windows only)Meaning
--install-service <NAME>Create service NAME that runs this .exe with the other arguments on the command line, plus --service <NAME>. Automatic (delayed start), depends on Tcpip, account NT SERVICE\<NAME>; after a failure it restarts after 5 s, 10 s, then every 60 s. Does not start the service. From 2.18.1: if a setting cannot be applied, the service is removed again and the command fails. From 2.22.0 the last success line is Start-Service <NAME>; when the service arguments include --config it is Grant the account read access to its config file, then: Start-Service <NAME>. Elevated prompt.
--uninstall-service <NAME>Stop the service, wait up to 30 s until it has stopped, then delete it; if it does not stop, nothing is deleted and the command fails. From 2.18.4: before deleting, it removes the account's access to the log directory (while NT SERVICE\<NAME> still resolves); if that fails, the service is left registered and stopped and the command fails with the icacls command to run, so fix it and uninstall again. Logs are kept.
--service <NAME>Run under the Service Control Manager; set by the installer.
--log-file <PATH>Append stats and logs to PATH instead of the console.

As a service, stats and logs go to one file, %ProgramData%\solidfokus\logs\<NAME>.log, rotated above 10 MiB to .1….5 (checked every 30 s, no restart). Stop-Service, sc.exe stop, system shutdown and reboot take the Ctrl+C path: on a server first the 5 s zero-port drain (section 8), then the final summary and the 5 s aggregator and 5 s POST drains, so a server stop takes up to about 15 s; a client stop up to about 10 s. From 2.19.0 the service accepts preshutdown, reports progress every second while stopping (20 s wait hint), and --install-service sets the preshutdown timeout to 30 s. A service installed by an earlier version keeps the Windows default (10 s on Windows 10 1703 and later) until it is reinstalled, which is too short for a full drain at reboot: run --uninstall-service <NAME>, then the same command line with --install-service <NAME> (sc.exe qc <NAME> shows it). Stop-Service works without the reinstall.

Boot and delayed start: --install-service creates the service as Automatic (Delayed Start), so after a reboot Windows starts it about two minutes after the other automatic services; on Windows 11 this can take several minutes. Clients of a Windows server wait in probing during that time and report no loss, but they have no measurements until it is back. For a server that must return promptly after a reboot, switch it to plain automatic start (elevated): sc.exe config tracerlight-server start= auto (the space after start= is required). Check with sc.exe qc tracerlight-server: START_TYPE shows 2 AUTO_START (DELAYED) for delayed and 2 AUTO_START for automatic. A reinstall (--install-service) sets delayed start again.

Tested: the 2.19.0 server drain was verified on real Linux, FreeBSD, OpenBSD and Windows 11 servers, including a Windows reboot: server stops took 5.0–5.2 s and clients reported zero loss.

Start-up (2.18.1 and later): the service is start pending until it is ready, then running: the server once every port is bound, the client once the target resolves, the probe answers and every session socket is bound. Start-Service waits for that. If start-up fails (bad config, port in use, name that does not resolve, probe timeout after 30 s), the service stops with service-specific exit code 1, Start-Service fails, and the error is the last line of the log. At boot it waits for Tcpip and starts delayed; a target that does not resolve yet is retried by the restart actions every 60 s. 2.18.0 reported running at once and restarted only three times.

Install and log file (2.18.2 and later): --install-service creates the log directory and grants the service account modify access to it; if either fails, the service is removed again and the command exits 1. A relative --log-file is stored as an absolute path, and the install prints the log file it will use. Further service-specific exit codes: 2, the log file cannot be opened (see sc.exe query <NAME>, since nothing reaches the log); 3, start-up did not finish within 180 s (the process exits and the restart actions run).

Log directory (2.18.3 and later): the service account gets modify access to the log directory, so a --log-file directory must be inside %ProgramData% (not %ProgramData% itself) and must not contain the .exe; a drive root, C:\Windows, Program Files or the program's own directory is rejected and no service is created. --uninstall-service removes that access again; from 2.18.4 this happens before the service is deleted, and if it fails the service is kept (see the table). From 2.18.6, a junction or symbolic link on the log path, or a directory there owned by a non-administrator, is rejected before the service is created; the log directory's permissions are replaced (SYSTEM and Administrators full control, other services kept), so add hand-made entries on %ProgramData%\solidfokus\logs again after install. A failed install restores them. For exit code 2 the reason is in the Application event log, source = service name: Get-WinEvent -LogName Application -MaxEvents 200 | ? ProviderName -eq '<NAME>' | % { $_.Properties[0].Value }.

Known issue in 2.18.7 and earlier: on current Windows 11 --install-service fails with cannot set the recovery actions: IO error in winapi call: Access is denied. (os error 5); the service was removed again, also from an elevated prompt or as SYSTEM. The install opened the new service without the start right that Windows requires for restart recovery actions. Fixed in 2.18.8, verified on real Windows 11. A service installed by an earlier version may have no restart actions (sc.exe qfailure <NAME> lists none). To add the documented ones (5 s, 10 s, then every 60 s, count reset after a day), run elevated: sc.exe failure <NAME> reset= 86400 actions= restart/5000/restart/10000/restart/60000 and sc.exe failureflag <NAME> 1.

Install the binary

$ver = "2.22.1-f136bd5"   # from download.solidfokus.com
$url = "https://download.solidfokus.com/public/tracerlight/x86_64-unknown-windows/tracerlight-$ver.exe"
$dir = "C:\Program Files\SolidFokus"
New-Item -ItemType Directory -Force $dir | Out-Null
Invoke-WebRequest $url -OutFile "$dir\tracerlight.exe"
Invoke-WebRequest "$url.sha256" -OutFile "$env:TEMP\tracerlight.sha256"
$want = (Get-Content "$env:TEMP\tracerlight.sha256").Split(" ")[0]
if ((Get-FileHash "$dir\tracerlight.exe" -Algorithm SHA256).Hash -ne $want) { throw "SHA-256 mismatch" }
$exe = "$dir\tracerlight.exe"
& $exe -V

--install-service records the path of the .exe it runs from, so put the binary in its final place first. The service account NT SERVICE\<NAME> must be able to read the .exe: C:\Program Files\SolidFokus works, but an .exe under your user profile (C:\Users\<user>\…, such as Downloads) installs without an error and then fails to start.

Server

# Test in the foreground first (Ctrl+C stops it)
& $exe -s -k 1234567890 -p 9000 -n 32 -o json --log-format json 0.0.0.0

# Install, start, check
& $exe -s -k 1234567890 -p 9000 -n 32 -o json --log-format json 0.0.0.0 --install-service tracerlight-server
Start-Service tracerlight-server
Get-Service tracerlight-server
Get-Content -Wait "$env:ProgramData\solidfokus\logs\tracerlight-server.log"

# Firewall: inbound UDP for the whole range (outbound is allowed by default)
New-NetFirewallRule -DisplayName "Tracerlight server UDP 9000-9031" -Direction Inbound -Protocol UDP -LocalPort 9000-9031 -Action Allow

Windows server sockets use SO_EXCLUSIVEADDRUSE, so the all-or-nothing bind works as on Unix. Windows reserves blocks of ports (Hyper-V, WSL, Docker): a range that overlaps one fails with OS error 10013, a port in use with 10048. List them:

netsh interface ipv4 show excludedportrange protocol=udp
netsh interface ipv6 show excludedportrange protocol=udp

Client

# HTTP POST config, readable by the service account only
$cfg = "$env:ProgramData\solidfokus\tracerlight"
New-Item -ItemType Directory -Force $cfg | Out-Null
& $exe --config | Out-File -Encoding ascii "$cfg\post-config.json"
notepad "$cfg\post-config.json"      # set url, username, password

# Test in the foreground first
& $exe -k 1234567890 -p 9000 -n 32 -r 32 -o json --log-format json -t dc-east --config "$cfg\post-config.json" server.example.com

# Install, then grant the virtual account read access, then start
# icacls must come after --install-service: NT SERVICE\tracerlight-client only exists once the
# service is created; before that icacls fails with "No mapping between account
# names and security IDs". --install-service does not start the service.
& $exe -k 1234567890 -p 9000 -n 32 -r 32 -o json --log-format json -t dc-east --config "$cfg\post-config.json" server.example.com --install-service tracerlight-client
icacls $cfg /inheritance:r /grant:r "*S-1-5-32-544:(OI)(CI)F" "*S-1-5-18:(OI)(CI)F" "NT SERVICE\tracerlight-client:(OI)(CI)RX"
Start-Service tracerlight-client

-Encoding ascii matters on Windows PowerShell 5.1, where utf8 writes a byte order mark the JSON parser rejects. The icacls line removes inherited access and leaves Administrators, SYSTEM and the service account. Run it after --install-service: the virtual account NT SERVICE\<NAME> does not exist until the service is created (otherwise: “No mapping between account names and security IDs”).

ICMP on Windows (2.18.1 and later): client sockets turn off SIO_UDP_CONNRESET, as server sockets do, so an ICMP port unreachable cannot make the receive loop spin. icmp_port_unreachable stays 0 on Windows; a server that is down shows as lost.

Operate, change, upgrade

Stop-Service tracerlight-client        # graceful: final summary + POST drain (server: 5 s zero-port drain first)
Restart-Service tracerlight-client
sc.exe qc tracerlight-client           # command line, account, Tcpip dependency, start type
sc.exe qfailure tracerlight-client     # restart actions

# RUST_LOG for one service (then restart it)
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\tracerlight-client" -Name Environment -Type MultiString -Value "RUST_LOG=debug"

# Change arguments: remove and install again
& $exe --uninstall-service tracerlight-client
& $exe <new arguments> --install-service tracerlight-client

# Upgrade: stop, replace the .exe (same path), start. Upgrade clients before servers (section 8).
Stop-Service tracerlight-server, tracerlight-client
Copy-Item "$env:TEMP\tracerlight-new.exe" $exe -Force
Start-Service tracerlight-server, tracerlight-client

Each service name has its own virtual account (NT SERVICE\tracerlight-server, NT SERVICE\tracerlight-client), with no password. --install-service grants it modify access to %ProgramData%\solidfokus\logs. Run more instances under other names, e.g. tracerlight-client-dc2.

6. Logging

Many servers and clients per host, each writing its own JSON log file for your own log shipper: Deploy option 1, Tracerlight only. Full stack over HTTP (Tracerlight + Gyroscopic + Tailfin): Deploy option 2. The examples below run one server and one client per host.

Stats go to stdout (--output); operational logs go to stderr (--log-format, level via RUST_LOG). Since 2.17.0, --output json no longer makes logs JSON; add --log-format json. There is no built-in rotation.

FreeBSD /usr/local/etc/newsyslog.conf.d/solidfokus.conf (newsyslog sends SIGHUP to the daemon supervisor, which reopens the file):

# logfilename                                 [owner:group]           mode count size when  flags [/pid_file]           [sig_num]
/var/log/solidfokus/tracerlight_server.log    tracerlight:tracerlight 640  7     *    @T00  ZB    /var/run/tracerlight_server.pid
/var/log/solidfokus/tracerlight_client.log    tracerlight:tracerlight 640  7     *    @T00  ZB    /var/run/tracerlight_client.pid

Append these lines to the shared /usr/local/etc/newsyslog.conf.d/solidfokus.conf (create it if absent); never replace that file, since Tracerlight, Gyroscopic and Tailfin share it, and do not add a second line for the same log. Z gzips rotated logs; B stops newsyslog writing its plain-text turnover banner into the JSON log. Every FreeBSD entry needs the pid file, otherwise newsyslog signals syslogd.

OpenBSD: newsyslog reads only /etc/newsyslog.conf (there is no conf.d). Append the lines for the instances this host runs:

# logfilename                                 owner:group                mode count size when  flags command
/var/log/solidfokus/tracerlight_server.log    _tracerlight:_tracerlight  640  7     *    @T00  ZB    "/usr/sbin/rcctl restart tracerlight_server"
/var/log/solidfokus/tracerlight_client.log    _tracerlight:_tracerlight  640  7     *    @T00  ZB    "/usr/sbin/rcctl restart tracerlight_client"

A shell redirection cannot be reopened, so newsyslog renames the log, creates a new one with the owner and mode above, and runs the quoted command to restart the instance. It compresses the old file only after that, so no lines are lost. The cost is a gap of a few seconds (up to about 15 s if the telemetry endpoint is unreachable) once a day; clients reconnect on their own. Syslog (daemon_logger) is not used for Tracerlight because it prefixes every line and logger(1) splits lines over 1023 bytes, which large stats lines exceed.

Tested on OpenBSD 7.9 and 8.0 (2026-11-27) with 2.22.1-f136bd5: these newsyslog lines as printed, with a forced rotation (newsyslog -F), a size-triggered run, a time-triggered run with the clock set forward, and count 7. The rotated file was gzipped after the restart, the new file had the owner and mode above, the instance restarted and kept writing, and clients resumed on their own. Not yet tested: a scheduled midnight (@T00) run by cron, and RUST_LOG through the login class.

JSON output reference

With --output json every stats record is one JSON object on one line of stdout; with --log-format json every log record is one JSON object on one line of stderr. Stats records have the key event, log records have level. Keys in stats records are in alphabetical order. Real lines from 2.22.0-a507b62 (loopback, -n 4 -r 32):

Client stats and final:

{"duplicated":0,"event":"stats","icmp_host_unreachable":0,"icmp_network_unreachable":0,"icmp_port_unreachable":0,"lost":0,"received":256,"recv_error":0,"reordered":0,"rtt_avg_ns":306755,"rtt_max_ns":515599,"rtt_min_ns":175399,"rtt_p50_ns":320729,"rtt_p90_ns":388846,"rtt_p95_ns":425984,"rtt_p99_ns":507904,"send_error":0,"sent":256,"tag":"cli-a-srv1","timestamp":"2026-11-14T14:45:48.588945706+00:00","too_high":0,"too_low":0,"uptime_ms":2001}
{"duplicated":0,"event":"final","icmp_host_unreachable":0,"icmp_network_unreachable":0,"icmp_port_unreachable":0,"lost":0,"received":768,"recv_error":0,"reordered":0,"rtt_avg_ns":301037,"rtt_max_ns":4714239,"rtt_min_ns":42489,"rtt_p50_ns":313064,"rtt_p90_ns":392135,"rtt_p95_ns":430665,"rtt_p99_ns":589824,"send_error":0,"sent":768,"tag":"cli-a-srv1","timestamp":"2026-11-14T14:45:53.591519884+00:00","too_high":0,"too_low":0,"uptime_ms":7003}

Server stats and final:

{"decode_error":0,"event":"stats","invalid_key":0,"packets_received":334,"packets_sent":334,"recv_error":0,"send_error":0,"tag":"srv1","timestamp":"2026-11-14T14:45:49.187685258+00:00","uptime_ms":3001}
{"decode_error":0,"event":"final","invalid_key":0,"packets_received":769,"packets_sent":769,"recv_error":0,"send_error":0,"tag":"srv1","timestamp":"2026-11-14T14:46:11.189244917+00:00","uptime_ms":25003}

Log records, and a plain-text start-up error:

{"timestamp":"2026-11-14T14:45:46.587530Z","level":"INFO","fields":{"message":"tracerlight starting","role":"client","tag":"cli-a-srv1","pid":293297,"version":"2.22.0","git_sha":"c6d1d7e"},"target":"tracerlight"}
{"timestamp":"2026-11-14T14:45:46.587554Z","level":"INFO","fields":{"message":"Starting client","target":"127.0.0.1","base_port":19100,"num_sessions":4,"interval":1,"rate":32,"no_probe":false,"tag":"Some(\"cli-a-srv1\")"},"target":"tracerlight::client"}
Error: failed to bind 127.0.0.1:19100: Failed to bind 127.0.0.1:19100: Address in use (os error 98)

Client stats (23 keys with --tag):

KeyTypeMeaning
timestampstringUTC time of the record, RFC 3339 with nanoseconds and +00:00
eventstringstats every interval, final once on a clean stop
tagstringthe --tag value; the key is missing without --tag
uptime_msintegermilliseconds since the process started
sentinteger, cumulativepackets sent
receivedinteger, cumulativereplies matched to a packet still in the window (a duplicate reply counts again)
lostinteger, cumulativepackets with no reply when their slot was reused, that is after about --timeout seconds
reorderedinteger, cumulativereplies that arrived after the reply to a later packet
duplicatedinteger, cumulativesecond and later replies to the same packet
too_lowinteger, cumulativereplies to packets already outside the window (already counted lost)
too_highinteger, cumulativereplies with a sequence number not sent yet
send_errorinteger, cumulativesocket send errors
recv_errorinteger, cumulativesocket receive errors
icmp_port_unreachableinteger, cumulativeICMP port unreachable received (always 0 on Windows)
icmp_host_unreachableinteger, cumulativeICMP host unreachable received
icmp_network_unreachableinteger, cumulativeICMP network unreachable received
rtt_avg_ns, rtt_min_ns, rtt_max_nsinteger, ns, this intervalaverage, minimum and maximum round-trip time; final: over the whole run
rtt_p50_ns, rtt_p90_ns, rtt_p95_ns, rtt_p99_nsinteger, ns, this intervalround-trip time percentiles from a histogram, so values are bucket-rounded; final: over the whole run

Server stats (10 keys with --tag):

KeyTypeMeaning
timestampstringas for clients
eventstringstats or final
tagstringthe --tag value (missing without it)
uptime_msintegermilliseconds since the server started
packets_receivedinteger, cumulativeUDP packets received from clients
packets_sentinteger, cumulativeecho replies sent back
invalid_keyinteger, cumulativepackets dropped because the --key differs
decode_errorinteger, cumulativepackets that did not decode as Tracerlight packets
recv_errorinteger, cumulativesocket receive errors (receive buffer exhaustion shows here)
send_errorinteger, cumulativesocket send errors

Log records:

KeyTypeMeaning
timestampstringUTC, RFC 3339 with microseconds and Z
levelstringERROR, WARN, INFO, DEBUG, TRACE (RUST_LOG sets the minimum, default info)
fields.messagestringthe message; other keys in fields depend on the message (for example role, pid, version and git_sha in tracerlight starting, and tag when --tag is set)
targetstringthe part of Tracerlight that wrote it, for example tracerlight::client

7. Verify

# Local end-to-end test
tracerlight --server --key 42 -p 9000 -n 4 &
tracerlight --key 42 127.0.0.1 -p 9000 -n 4 -r 32 -i 1    # Ctrl+C after a few lines
# Expect lines with sent / received / lost / rtt values and a final summary.

# Service status
systemctl status tracerlight-server      # Linux
service tracerlight_server status        # FreeBSD
rcctl check tracerlight_server           # OpenBSD

# Telemetry arrived in Gyroscopic (tailfin read credentials)
# OpenBSD: curl is not in base; run pkg_add curl first
curl -fsS -u "tailfin:$TAILFIN_SECRET" "http://stats.example.net:3000/api/v1/latest?tag=client-a-server1&type=client"

Notes and troubleshooting

CPU and memory per rate, and server capacity per core: Tracerlight, Performance. More symptoms, causes and fixes per OS: Troubleshooting.

8. Upgrade, restart and graceful server stop

Upgrade procedure

  1. Order: Gyroscopic first (see its install page), then all Tracerlight clients, then the Tracerlight servers. A client older than 2.19.0 ignores the drain and counts loss during a server restart, and exits if it probes while a server is draining.
  2. On each host: download and verify the new binary (section 1) and check it with -V.
  3. Replace the binary at the same path and restart the service. A client restart starts its counters from zero; Gyroscopic records it as a client restart.
  4. Windows hosts upgraded from a version before 2.19.0: reinstall each server service once (--uninstall-service, then --install-service with the same arguments) to get the 30 s preshutdown timeout. Then Start-Service.
  5. Upgrade the servers one at a time. The first restart of a server from a version before 2.19.0 shows loss on its clients; every later upgrade or reboot of a 2.19.0 server drains without loss.
  6. Verify (section 7): the service runs, clients report again in Gyroscopic, and lost did not rise during the server restart.
# Linux (systemd)
install -m 0755 tracerlight-2.22.1-f136bd5 /usr/local/bin/tracerlight
systemctl restart tracerlight-client      # clients first; later: tracerlight-server

# FreeBSD
install -m 0555 tracerlight-2.22.1-f136bd5 /usr/local/bin/tracerlight
service tracerlight_client restart        # later: tracerlight_server

# OpenBSD
install -m 0555 tracerlight-2.22.1-f136bd5 /usr/local/bin/tracerlight
rcctl restart tracerlight_client          # later: tracerlight_server

# Windows: see "Operate, change, upgrade" in section 5
tracerlight -V                            # -> tracerlight 2.22.1-f136bd5

9. Uninstall

These steps reverse sections 1–5. Run them as root (Windows: elevated PowerShell) and remove only the roles or instances the host runs. Hosts set up with Deploy option 1 have instances named tracerlight-<role>-<tag>; use the option 1 lines for those. Remove clients before the server they test, or they report it as lost.

Deleting log files is your choice. /var/log/solidfokus, C:\Program Files\SolidFokus, %ProgramData%\solidfokus and the FreeBSD file /usr/local/etc/newsyslog.conf.d/solidfokus.conf are shared with Gyroscopic and Tailfin: remove only Tracerlight's lines and files from them, and a directory only when it is empty.

Linux (systemd)

# Role units (section 5)
systemctl disable --now tracerlight-server tracerlight-client      # the roles this host runs
rm -f /etc/systemd/system/tracerlight-server.service /etc/systemd/system/tracerlight-client.service

# Option 1 instances instead
systemctl list-units --all 'tracerlight-*@*'
systemctl disable --now tracerlight-server@srv1 tracerlight-client@cli-a-srv1   # every instance listed
rm -f /etc/systemd/system/tracerlight-server@.service /etc/systemd/system/tracerlight-client@.service
rm -f /etc/logrotate.d/solidfokus-tracerlight

# Both
systemctl daemon-reload
rm -r /etc/tracerlight                         # config, arguments files and the key
userdel tracerlight
getent group tracerlight && groupdel tracerlight  # if a group is left
rm /usr/local/bin/tracerlight

# Optional: option 1 log files (the role units log to journald)
rm -f /var/log/solidfokus/tracerlight*
rmdir /var/log/solidfokus                      # only if empty

FreeBSD (rc.d)

# Role scripts (section 5)
service tracerlight_server stop                # and/or tracerlight_client
rm -f /usr/local/etc/rc.d/tracerlight_server /usr/local/etc/rc.d/tracerlight_client

# Option 1 instead
service tracerlight stop                       # all instances
rm -f /usr/local/etc/rc.d/tracerlight

# Both
sysrc -a | grep '^tracerlight_'                # every Tracerlight line in rc.conf
sysrc -x tracerlight_server_enable tracerlight_server_args   # each name listed above
# Delete the tracerlight lines from /usr/local/etc/newsyslog.conf.d/solidfokus.conf
rm -r /usr/local/etc/tracerlight
pw userdel tracerlight
pw groupshow tracerlight >/dev/null 2>&1 && pw groupdel tracerlight   # if a group is left
rm /usr/local/bin/tracerlight

# Optional: log files
rm -f /var/log/solidfokus/tracerlight*

OpenBSD (rc.d)

ls /etc/rc.d/tracerlight_*                     # tracerlight_server, tracerlight_client, or option 1 names
rcctl stop tracerlight_server                  # each name listed
rcctl disable tracerlight_server
rm /etc/rc.d/tracerlight_server
grep tracerlight /etc/rc.conf.local 2>/dev/null   # must print nothing; the file may not exist
# Delete the tracerlight lines from /etc/newsyslog.conf
rm -f /etc/login.conf.d/tracerlight_*          # only if you made a RUST_LOG login class
rm -r /etc/tracerlight
userdel _tracerlight
groupdel _tracerlight
rm /usr/local/bin/tracerlight

# Optional: log files
rm -f /var/log/solidfokus/tracerlight*

If /etc/login.conf.db exists and you removed a login class, rebuild it with cap_mkdb as login.conf(5) describes.

Windows (native service)

$exe = "C:\Program Files\SolidFokus\tracerlight.exe"
Get-Service tracerlight-*                      # every Tracerlight service on the host
& $exe --uninstall-service tracerlight-server  # once per service listed
Get-NetFirewallRule -DisplayName "Tracerlight*" | Select-Object DisplayName
Remove-NetFirewallRule -DisplayName "Tracerlight server UDP 9000-9031"   # each rule you created
Remove-Item -Recurse "$env:ProgramData\solidfokus\tracerlight"         # config, if you created one
Remove-Item $exe

# Optional: log files
Remove-Item "$env:ProgramData\solidfokus\logs\tracerlight-*.log*"

Run --uninstall-service before deleting the .exe: the .exe removes its own service. It stops the service, removes the service account's access to the log directory, and deletes the service. If it fails, it prints the icacls command to run; run it and uninstall again. If you granted a log shipper read access (option 1), remove that with icacls "$env:ProgramData\solidfokus\logs" /remove "<SHIPPER ACCOUNT>".

Firewall

Remove the inbound UDP rule you added in section 4, with the same range:

# Linux (iptables)
iptables -D INPUT -p udp --dport 9000:9063 -j ACCEPT
# Linux (firewalld)
firewall-cmd --remove-port=9000-9063/udp --permanent && firewall-cmd --reload
# FreeBSD / OpenBSD (pf): delete the pass rule for the range from your ruleset and reload pf

Check: tracerlight -V is not found, and no Tracerlight service is listed.

Tested on FreeBSD 15.1 (2026-11-23): the FreeBSD steps for option 1 instances (one server host, one client host), except the firewall step. Tested on Ubuntu 24.04 (2026-11-25): the Linux steps for the role units, except the firewall step. Tested on Windows Server 2022 (2026-11-25): the Windows steps. Tested on OpenBSD 7.9 and 8.0 (2026-11-26): the OpenBSD steps, including removing the pf rule. Tested on Ubuntu 24.04 (2026-11-26): the Linux firewall steps (iptables and firewalld). Not yet tested on a real host: the FreeBSD role-script steps and the Linux option 1 instance steps.