nest-status-monitor
Simple, self-hosted module based on Socket.io and Chart.js to report realtime
server metrics for Nest.js based node servers.
Demo
Demo can be found here
Installation & setup
- Run
npm install nest-status-monitor --save
- Setup module:
@Module({
imports: [StatusMonitorModule.setUp(statusMonitorConfig)],
- Run server and go to
/status
Run examples
- Go to
cd examples/test-status-monitor
- Run
npm i
- Run server
npm start
- Go to
http://localhost:3001
Options
Monitor can be configured by passing options object during initialization of
module.
Default config:
pageTitle: 'Nest.js Monitoring Page',
port: 3001,
path: '/status',
ignoreStartsWith: '/healt/alive',
spans: [
{
interval: 1,
retention: 60,
},
{
interval: 5,
retention: 60,
},
{
interval: 15,
retention: 60,
}
],
chartVisibility: {
cpu: true,
mem: true,
load: true,
responseTime: true,
rps: true,
statusCodes: true,
},
healthChecks: []
Health Checks
You can add a series of health checks to the configuration that will appear
below the other stats. The health check will be considered successful if the
endpoint returns a 200 status code.
healthChecks: [
{
protocol: 'http',
host: 'localhost',
path: '/health/alive',
port: 3001,
},
{
protocol: 'http',
host: 'localhost',
path: '/health/dead',
port: 3001,
},
];
License
MIT License © Ivan Vasiljevic
Forked from
express-status-monitor