2.0.1 • Published 6 years ago

@jwdotjs/uptime v2.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Uptime Monitoring That Logs To Sentry

Requirements

  • You must have SENTRY_DSN specified in your .env

Config

  • In the below example, the request object gets passed directly to Axios
  • If you don't specify an HTTP Method in the request, it will default to GET
  • If you don't specify an interval it will default to 60 seconds
const uptime = require('@jwdotjs/uptime');

uptime({
  monitoring: [
    {
      request: {
        url: '',
        method?: 'GET'|'POST'|'PUT'|'DELETE',
        headers?: {},
        data?: {},
      },
      interval?: 60000,
    },
  ],
  maxAttempts: 2, // how many total times a request should fail consecutively before we log an error
}).init();

Example Usage

const uptime = require("@jwdotjs/uptime");

uptime({
  monitoring: [
    { request: { url: "http://www.google.com" } },
    { request: { url: "http://www.yahoo.com" } },
    { request: { url: "http://www.sitewithanoutage.com" } }
  ],
  maxAttempts: 2 // how many total times a request should fail consecutively before we log an error
}).init();

Result In Console

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago