A simple http watchdog to monitor app health
This watchdog is a side car container that sits next to your application process / container. The watchdog is configured via an environment file or direct environment variables injected into the container at startup. From there, the watchdog polls the health of your application and sends alerts after a variable number of failures.
npm:
npm install http-watchdog
yarn:
yarn add http-watchdog
const Watchdog = require('http-watchdog');
const watchdog = new Watchdog({
healthcheck: 'http://localhost:3000/health'
});
watchdog.watch();
delay
- (number
, default:0
ms) - delay before checking health (in milliseconds)failureCount
- (number
, default:3
failures) - number of failures before sending an alertinterval
- (number
, default:5000
ms) - interval at which to poll against health checkhealthcheck
- (string
, default:undefined
) - healthcheck URL to poll against (success: 200, failure:4xx
,5xx
)logger
- (function
, default:null
) - A configurable logger triggered on alerttimeout
- (number
, default:1000
ms) - configurable healthcheck timeout
Name | Website |
---|---|
Shaun Warman | https://shaunwarman.com |