PMX is the programmatic integration library for PM2 and Keymetrics.io (v1.6.8, latest stable). It enables Node.js applications to expose custom metrics (simple values, counters, meters, histograms), triggerable remote functions, exception alerts, custom events, and network traffic monitoring to the PM2 CLI and Keymetrics dashboard. Released irregularly with minor version bumps, it supports Node.js >= 0.10. Key differentiators: deep PM2/Keymetrics integration, low-overhead metric probes, and production monitoring without external monitoring services.
npm install pmxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes PMX, creates a metric tracking user count and a counter for HTTP requests.
Use default import `import pmx from 'pmx'` and call `pmx.init()` with options if needed.
Always call `const probe = pmx.probe()` before using metric, counter, meter, or histogram.
Avoid using pmx.event(); instead emit custom events using pm2.connect or pm2.io packages.
Set `samples: 60` in meter options if you need per-minute averaging.
Use only valid measurement strings: 'mean', 'median', 'p75', 'p95', 'p99', 'p999'.
Run `npm install pmx --save` to add it to dependencies.
Use default import: `import pmx from 'pmx'` then `pmx.probe()`.
First create probe: `const probe = pmx.probe()` then use `probe.metric()`.
No dependency data recorded yet.