A high-performance daemon that accepts profiling data from the PHP tracking extension over a Unix socket and forwards it to the backend via a WebSocket connection.
Important: The backend must be running and accepting WebSocket connections before starting the daemon. The daemon establishes a WebSocket connection to the backend on startup and will exit immediately if it cannot connect.
cargo build --release
The compiled binary will be at target/release/php-tracking-daemon.
php-tracking-daemon --ws-host <hostname:port>
The --ws-host (or -H) argument is required and should be the hostname and port of the backend. Do not include the protocol or path — the daemon automatically constructs the full WebSocket URL (ws://<host>/ws).
# Connect to a backend running on localhost
php-tracking-daemon --ws-host localhost:3000
# Using the short flag
php-tracking-daemon -H localhost:3000
php-tracking-daemon --help
- The daemon listens for incoming connections on a Unix socket at
/tmp/php-tracking-daemon.sock. - The PHP tracking extension sends profiling data to this socket.
- The daemon compresses the data with gzip and forwards it to the backend over WebSocket.
- Multiple worker threads process messages concurrently for high throughput.
- If the WebSocket connection drops, the daemon automatically attempts to reconnect with exponential backoff.