Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ackee-node-monitor-module

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ackee-node-monitor-module

`Ackee Node Monitor Module`

  • 0.0.6
  • npm
  • Socket score

Version published
Weekly downloads
112
increased by5500%
Maintainers
1
Weekly downloads
 
Created
Source

Ackee Node Monitor Module

Ackee Node Monitor Module

Ackee Node Monitor Module collects request and response data to JSON and sends this information to collector [(Ackee Node Monitor)] is defined in configuration file. Ackee Node Monitor Module sends request to collector only if at least one request is in collection.

Installation

# Install from npm
npm install ackee-node-monitor-module --save

Usage

First add Ackee Node Monitor Module configuration into config.js:

module.exports = {
    ...
    ackeeNodeMonitor: {
            excludedUrls: ['/bower_components/', '/img/', '/js/', '/css/'],
            elastic: {
                host: 'someelastic.com:9200',
                log: 'trace',
            },
            winston: {
                level: 'silly',
                indexPrefix: 'nodetemplate-monitor',
            },
            customHeaders: [
                'User-Agent'
            ],
            customBody: [
                {
                    path: 'user.id',
                    name: 'userId'
                }
            ],
        }
    ...
}
Example
module.exports = {
    ...
    ackeeNodeMonitor: {
            excludedUrls: ['/bower_components/', '/img/', '/js/', '/css/'],
            elastic: {
                host: 'someelastic.com:9200',
                log: 'trace',
            },
            winston: {
                level: 'silly',
                indexPrefix: 'nodetemplate-monitor',
            },
            customHeaders: [
                'User-Agent'
            ],
            customBody: [
                {
                    path: 'user.id',
                    name: 'userId'
                }
            ],
        }},
     ...
}

then require and init Ackee Node Monitor Module in server.js before calling createServer (app.listen(port);):

...
const express = require('express');
const config = require('config');

// require and init ackee-node-monitor-module
require('ackee-node-monitor-module')(config.ackeeNodeMonitor);

const app = express();
...
const server = app.listen(port);

Console output

...
AckeeNodeMonitor init
...
info: Starting client for ackee-node-monitor-client at port 3099
::1 - - [19/Sep/2016:13:05:07 +0000] "GET /api/v1/test/1 HTTP/1.0" 200 6 "-" "ApacheBench/2.3"
::1 - - [19/Sep/2016:13:05:10 +0000] "GET /api/v1/test/2 HTTP/1.0" 200 6 "-" "ApacheBench/2.3"
::1 - - [19/Sep/2016:13:05:11 +0000] "GET /api/v1/test/3 HTTP/1.0" 200 6 "-" "ApacheBench/2.3"
AckeeNodeMonitor: Data sent to collector server. (3 requests)

Collected data

{ 
    "resTime": "response time in [ms]",
    "method": "HTTP method",
    "statusCode": "HTTP status code",
    "baseUrl": "express baseUrl",
    "path": "express path",
    "timestamp": "timestamp" 
}
Example
[
    { 
        "resTime": 20.411655,
        "method": "GET",
        "statusCode": 200,
        "baseUrl": "/api/v1",
        "path": "/test/1",
        "timestamp": 1474290307831 
    },
    { 
        "resTime": 5.7520999999999995,
        "method": "GET",
        "statusCode": 200,
        "baseUrl": "/api/v1",
        "path": "/test/2",
        "timestamp": 1474290310129 
    },
    { 
        "resTime": 4.104488,
        "method": "GET",
        "statusCode": 200,
        "baseUrl": "/api/v1",
        "path": "/test/3",
        "timestamp": 1474290311610 
    }
]

FAQs

Package last updated on 13 Oct 2016

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc