Skip to content

Utility to send heartbeat and data information from express.

Notifications You must be signed in to change notification settings

hammer-io/skadi

Repository files navigation

Build Status npm version

skadi

Utility to send heartbeat and data information from express.

Setup

Create a .skadiconfig.json file in the directory where you are launching your application from.

{
    "interval": "<optional interval in millisecnods>",
    "apiKey": "<apiKey from koma>",
    "heartbeatUrl": "<server url to koma heartbeats>",
    "osDataUrl": "<server url to koma os data>",
    "httpDataUrl": "<server url to koma http data>"
}

Usage

const skadi = require('skadi')

Heartbeat

With heartbeatUrl in the .skadiconfig.json file, add the following snippet after your imports.

skadi.heartbeat();

OS Data

With osDataUrl in the .skadiconfig.json file, add the following snippet after your imports.

skadi.osdata();

HTTP Data

To capture incoming requests, add the following snippet before your routes.

app.use((req, res, next) => {
  skadi.captureRequestData(req);
  next();
});

To capture outgoing responses, add the following snippet after your routes.

app.use((req, res, next) => {
  skadi.captureResponseData(req, res);
});

About

Utility to send heartbeat and data information from express.

Resources

Stars

Watchers

Forks

Packages

No packages published