@eng_priyabrata/pulse
v0.1.0
Published
Live health monitor for Node.js: CPU, memory, disk, API and database vitals with a built-in dashboard
Maintainers
Readme
pulse-vitals
Live health monitor for Node.js. It watches the machine it runs on (CPU, memory, disk), plus your API requests and database queries, raises alerts and trend warnings, and shows everything on a live dashboard that looks like a patient monitor.
Quick start
npx pulse-vitalsOpen the address it prints (default http://127.0.0.1:8080). Press Ctrl+C to stop.
Use it inside your app
const pulse = require("pulse-vitals");
await pulse.start({ port: 8080 });
// Express: track every request
app.use(pulse.apiMiddleware());
// Track a database query (any async function)
const users = await pulse.trackDb("mongo", () => User.find());
// later
await pulse.stop();require("pulse-vitals") does nothing until you call start(). PULSE never touches your app's signals or crash handling.
Options for start()
| Option | Default | Meaning |
|---|---|---|
| port | 8080 | Dashboard and data port |
| host | 127.0.0.1 | Address to listen on (this machine only) |
| token | none | Require ?token=... to view the dashboard |
| allowedOrigins | [] | Extra web page origins allowed to connect (development) |
| insecure | false | Allow a non-local host without a token |
| quiet | true | No console output |
| siren | false | Play a siren on critical alerts (needs node-wav-player) |
| maxSnapshots | 5000 | Snapshots kept in memory (one per 5 seconds) |
| ui | true | Serve the dashboard page |
start() returns { url, port }.
Command line
pulse-vitals --port 8080 --token secret --siren --quietFlags: --port, --host, --token (or PULSE_TOKEN), --allow-origin, --max-snapshots, --siren, --quiet, --no-ui, --insecure, --help.
Security
- Listens on
127.0.0.1only by default. - Refuses to listen on any other address without a
token(orinsecure: true). - Other websites cannot read the data: the connection origin is checked.
- The dashboard shows details of your machine. Use a token before exposing it.
Good to know
- It monitors the machine (or container) where it runs. Inside Docker or Kubernetes, memory and CPU can describe the host rather than the container limit.
- History is kept in memory and is lost on restart.
- API and database panels show "NO TRAFFIC" until
apiMiddlewareandtrackDbare used.
License
MIT
