# nest-status-monitor

> Realtime Monitoring for Express-based Node applications

Latest version **0.1.4** (published 2020-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install nest-status-monitor
pnpm add nest-status-monitor
yarn add nest-status-monitor
bun add nest-status-monitor
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2020-08-16 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 93.2 KB |
| Known vulnerabilities | 0 (+35 in 2 direct dependencies) |
| Install scripts | no |
| Author | ivanvs |
| Maintainers | genfirst |
| Keywords | nestjs, status, monitoring, node |

## Links

- npm: https://www.npmjs.com/package/nest-status-monitor
- Repository: https://github.com/GenFirst/nest-status-monitor
- Homepage: https://github.com/GenFirst/nest-status-monitor#readme
- Issues: https://github.com/GenFirst/nest-status-monitor/issues
- npm.io page: https://npm.io/package/nest-status-monitor

## Dependencies (9)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [debug](https://npm.io/package/debug.md) ^2.6.8
- [pidusage](https://npm.io/package/pidusage.md) ^1.1.6
- [socket.io](https://npm.io/package/socket.io.md) ^2.0.3
- [handlebars](https://npm.io/package/handlebars.md) 4.7.3
- [on-headers](https://npm.io/package/on-headers.md) ^1.0.2
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@nestjs/websockets](https://npm.io/package/@nestjs/websockets.md) ^6.11.11
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.8

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2020-08-16
- 0.1.3 — 2020-02-23
- 0.1.2 — 2019-11-12
- 0.1.1 — 2019-04-27
- 0.1.0 — 2019-04-26
- 0.0.3 — 2019-01-24
- 0.0.2 — 2018-11-28
- 0.0.1 — 2018-11-25

## README

# nest-status-monitor

[![NPM](https://nodei.co/npm/nest-status-monitor.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/nest-status-monitor/)

[![nest-status-monitor on npm](https://img.shields.io/npm/v/nest-status-monitor.svg)](https://www.npmjs.com/package/nest-status-monitor)
[![npm](https://img.shields.io/npm/dt/nest-status-monitor.svg)](https://img.shields.io/npm/dt/nest-status-monitor.svg)
[![Build Status](https://travis-ci.org/GenFirst/nest-status-monitor.svg?branch=master)](https://travis-ci.org/GenFirst/nest-status-monitor)
[![Coverage Status](https://coveralls.io/repos/github/GenFirst/nest-status-monitor/badge.svg?branch=master)](https://coveralls.io/github/GenFirst/nest-status-monitor?branch=master)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
[![Edit nest-status-monitor](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/yw1lov19q9?autoresize=1&initialpath=%2Fstatus)

Simple, self-hosted module based on Socket.io and Chart.js to report realtime
server metrics for Nest.js based node servers.

![Status monitor page](https://i.imgur.com/AkZEPYG.gif 'Status monitor page')

## Demo

Demo can be found [here](https://nest-status-monitor.herokuapp.com/status)

## Installation & setup Nest.js v6

1. Run `npm install nest-status-monitor --save`
2. Setup module:

```javascript
@Module({
  imports: [StatusMonitorModule.setUp(statusMonitorConfig)],
```

3. Run server and go to `/status`

## Installation & setup Nest.js v5

1. Run `npm install nest-status-monitor@0.0.3 --save`
2. Setup module:

```javascript
@Module({
  imports: [StatusMonitorModule.setUp(statusMonitorConfig)],
```

3. Run server and go to `/status`

## Run examples

1. Go to `cd examples/test-status-monitor`
2. Run `npm i`
3. Run server `npm start`
4. Go to `http://localhost:3001`

## Options

Monitor can be configured by passing options object during initialization of
module.

Default config:

```javascript
pageTitle: 'Nest.js Monitoring Page',
port: 3001,
path: '/status',
ignoreStartsWith: '/health/alive',
spans: [
  {
    interval: 1, // Every second
    retention: 60, // Keep 60 datapoints in memory
  },
  {
    interval: 5, // Every 5 seconds
    retention: 60,
  },
  {
    interval: 15, // Every 15 seconds
    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.

```javascript
// config
healthChecks: [
  {
    protocol: 'http',
    host: 'localhost',
    path: '/health/alive',
    port: 3001,
  },
  {
    protocol: 'http',
    host: 'localhost',
    path: '/health/dead',
    port: 3001,
  },
];
```

## License

[MIT License](https://opensource.org/licenses/MIT) © Ivan Vasiljevic

Forked from
[express-status-monitor](https://github.com/RafalWilinski/express-status-monitor)

---
_Source: https://npm.io/package/nest-status-monitor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
