Joel Male ef6fa1a07f fix: measure process CPU concurrently with system CPU
Previously system CPU was measured first (1s window), then processes
were sampled 1+ second later. Short-lived spikes would appear in system
CPU but not in the process list because the offending process had already
finished. Now both run in parallel so their windows overlap — a process
that caused a spike during the CPU measurement window will be captured.
2026-02-25 21:52:00 +10:00
2026-02-25 16:02:39 +10:00
2026-02-25 16:02:39 +10:00
2026-02-25 16:03:51 +10:00

Pulsewise Collector

Lightweight system metrics collector that reports CPU, memory, disk, network, and process data to Pulsewise.

Quick Install

curl -sSL https://pulsewise.app/install-collector.sh | TOKEN=your-token sudo -E bash

That's it. The script downloads the binary, writes the config, and starts a systemd service. Hostname is auto-detected.

If you prefer an interactive install (prompts for token and hostname):

curl -sSL https://pulsewise.app/install-collector.sh | sudo bash

What It Collects

Every 30 seconds, the collector sends:

Category Metrics
System OS, platform, platform version, kernel version, architecture, virtualization type, CPU model
Uptime Seconds since boot
Load average 1m, 5m, 15m
CPU Overall %, per-core %, core count
Memory Total, available, used, usage %
Swap Total, used, free, usage %
Disks Per mount point: device, fstype, total, free, used, usage %
Disk I/O Read/write bytes, read/write count, IOPS in progress
Network Bytes and packets sent/received per second (rate, not cumulative)
Processes Top 10 by CPU: PID, name, command, CPU%, memory%, CPU time, RSS

See payload.json for a full example of the JSON sent to the API.

Configuration

Config lives at /etc/pulsewise-collector/config:

TOKEN=your-token-here

All other options are optional:

Key Default Description
TOKEN (required) Your Pulsewise API token
HOSTNAME System hostname Override the reported hostname
URL https://pulsewise.app/api/collect Override the API endpoint
DEBUG false Log full response body from the server

Config file permissions should be 600 (root-only readable).

For local development on macOS, the collector also checks ~/.config/pulsewise-collector/config.

Development

# Create local config
mkdir -p ~/.config/pulsewise-collector
echo "TOKEN=test-token" > ~/.config/pulsewise-collector/config

# Build and run
./build.sh
./pulsewise-collector

To point at a local server:

TOKEN=test-token
URL=http://localhost:8000/api/collect
DEBUG=true

Cross-Compiling

GOOS=linux GOARCH=amd64 go build -o pulsewise-collector-linux-amd64
GOOS=linux GOARCH=arm64 go build -o pulsewise-collector-linux-arm64

Or use ./deploy.sh to compile both architectures and copy them into the Pulsewise Laravel app.

Managing the Service

sudo systemctl status pulsewise-collector
sudo journalctl -u pulsewise-collector -f
sudo systemctl restart pulsewise-collector
sudo systemctl stop pulsewise-collector

How It Works

  • Collects metrics every 30 seconds using gopsutil
  • Sends JSON via POST to the configured URL with Authorization: Bearer <token>
  • Network metrics are computed as per-second rates (delta between intervals); the first collection sends null for network
  • Runs as a systemd service with automatic restart on failure

License

MIT

S
Description
No description provided
Readme
98 KiB
Languages
Go 79%
Shell 21%