Socket
Socket
Sign inDemoInstall

@ceejbot/restify-monitor

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ceejbot/restify-monitor

an extraction of common npm microservice monitoring functions


Version published
Weekly downloads
1
Maintainers
1
Install size
41.1 kB
Created
Weekly downloads
 

Readme

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

Last updated on 25 May 2015

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc