Socket
Book a DemoInstallSign in
Socket

@ceejbot/restify-monitor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ceejbot/restify-monitor

an extraction of common npm microservice monitoring functions

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

restify-monitor

Add monitoring endpoints to an npm service. One stop shop.

Travis Coverage

This module has been published to our npm-enterprise registry as @npm/restify-monitor

Usage

To install: npm install --save @npm/restify-monitor.

var restify = require('restify');
var monitor = require('@npm/restify-monitor');

var server = restify.createServer();
monitor(server,
{
    logger: bole('my-little-pony'),
    metrics: myMetricsClient
});

What it does: Adds a logging after handler to the restify server. If you provide metrics and logger fields in the options object, it'll decorate each request with them. Also adds GET and HEAD routes for two monitoring endpoints.

GET /_monitor/ping: responds with 200 pong.

GET /_monitor/status: responds with a status object containing the following data:

  • name: the server name you provided to restify
  • pid: process.pid
  • uptime: process.uptime()
  • rss: process.memoryUsage()
  • git: hash of the head commit if the process is running in a git repo
  • message: commit message of the head commit if the process is in a git repo

License

ISC.

FAQs

Package last updated on 25 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.