0.0.1-alpha.2 • Published 5 years ago

http-watchdog v0.0.1-alpha.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

http-watchdog

build status code coverage code style styled with prettier made with lass license npm downloads

A simple http watchdog to monitor app health

Overview

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.

Table of Contents

Install

npm:

npm install http-watchdog

yarn:

yarn add http-watchdog

Usage

const Watchdog = require('http-watchdog');

const watchdog = new Watchdog({
  healthcheck: 'http://localhost:3000/health'
});

watchdog.watch();

Options

  • delay - (number, default: 0 ms) - delay before checking health (in milliseconds)
  • failureCount - (number, default: 3 failures) - number of failures before sending an alert
  • interval - (number, default: 5000 ms) - interval at which to poll against health check
  • healthcheck - (string, default: undefined) - healthcheck URL to poll against (success: 200, failure: 4xx, 5xx)
  • logger - (function, default: null) - A configurable logger triggered on alert
  • timeout - (number, default: 1000 ms) - configurable healthcheck timeout

Contributors

NameWebsite
Shaun Warmanhttps://shaunwarman.com

License

MIT © Shaun Warman