GithubHelp home page GithubHelp logo

runtimetools / appmetrics-statsd Goto Github PK

View Code? Open in Web Editor NEW
35.0 9.0 13.0 141 KB

A connector that collects data using 'appmetrics' and sends it to a configured StatsD server using 'node-statsd'.

License: Apache License 2.0

JavaScript 100.00%

appmetrics-statsd's Introduction

StatsD Connector for Node Application Metrics

A connector that collects data using appmetrics and sends it to a configured StatsD server using hot-shots, a fork of node-statsd.

Getting Started

Installation

The StatsD Connector for Node Application Metrics can be installed via npm:

$ npm install appmetrics-statsd

Configuring the StatsD Connector for Node Application Metrics

The connector can be used in your application by requiring it as the first line of your application:

var appstatsd = require('appmetrics-statsd').StatsD();

Configuration of the connection to the StatsD server is possible by passing parameters to the StatsD() function. These are passed directly though to the StatsD constructor in the node-statsd module. Information for that module is available here: https://www.npmjs.com/package/node-statsd

Additional data may also be sent to StatsD using the standard node-statsd module Client APIs, eg.

var statsd = require('appmetrics-statsd').StatsD();

statsd.gauge('gauge', 10.4);

Data Provided

The connector sends the following data values to StatsD from Node Application Metrics:

hot-shots

The hot-shots package provides all of the base statsd functionality for the below, and also includes additional functionality for users of Datadog and Telegraf. See the hot-shots documentation for more details.

CPU

Gauges

  • cpu.process the CPU usage of the application as a percentage of total machine CPU
  • cpu.system the CPU usage of the system as a percentage of total machine CPU

System Memory

Gauges

  • memory.process.private the amount of memory used by the Node.js application that cannot be shared with other processes, in bytes.
  • memory.process.physical the amount of RAM used by the Node.js application in bytes.
  • memory.process.virtual the memory address space used by Node.js application in bytes.
  • memory.system.used the total amount of RAM in use on the system in bytes.
  • memory.system.total the total amount of RAM available on the system in bytes.

####Event Loop

  • eventloop.latency.min the shortest sampled latency for processing an event
  • eventloop.latency.max the longest sampled latency for processing an event
  • eventloop.latency.avg the mean sampled latency for processing an event

####Garbage Collection

Gauges

  • gc.size the size of the JavaScript heap in bytes.
  • gc.used the amount of memory used on the JavaScript heap in bytes.

Timers

  • gc.duration the duration of the GC cycle in milliseconds.

####HTTP Requests

Timers

  • http the time taken for the HTTP request to be responded to in ms.

####Socket.io

Timers

  • socketio.broadcast.<event> the time taken for the broadcast to all clients of the named socketio event.
  • socketio.emit.<event> the time taken for the emit to a single client of the named socketio event.
  • socketio.receive.<event> the time taken for a received named socketio event to be handled.

####MySQL Queries

Timers

  • mysql the time taken for the given MySQL query to be responded to in ms.

####MongoDB Queries

Timers

  • mongo the time taken for the given MongoDB query to be responded to in ms.

####Leveldown Queries

Timers

  • levedown.get the time taken for the Leveldown get to be responded to in ms.
  • levedown.put the time taken for the Leveldown put to be responded to in ms.
  • levedown.del the time taken for the Leveldown del to be responded to in ms.
  • levedown.batch the time taken for the Leveldown batch to be run in ms.

####Redis Queries

Timers

  • redis.<cmd> the time taken for the given Redis command to be responded to in ms.

####Memcached Operations

Timers

  • memcached.<method> the time taken for the given Memcached method to be responded to in ms.

####PostgreSQL Queries

Timers

  • postgres the time taken for the given PostgresSQL query to be responded to in ms.

####MQTT Messaging

Timers

  • mqtt.<method>.<topic> the time taken for a MQTT message to handled on a given topic in ms.

####MQLight Messaging

Timers

  • mqlight.<method>.<topic> the time taken for a MQLight message to handled on a given topic in ms.

License

The Node Application Metrics to StatsD Connector is licensed using an Apache v2.0 License.

Version

3.1.0

Version History

3.1.0 Use hot-shots rather thab node-statsd

3.0.0 Remove fixed version of appmetrics in package.json

2.0.0 Update appmetrics version to 3.x.x

1.0.1 Add support for Event Loop, HTTP, Socketio, MongoDB, MySQL, Leveldown, Redis, Memcached, POstgreSQL, MQTT and MQLight
1.0.0 Initial release

appmetrics-statsd's People

Contributors

jeremy-j-ackso avatar mattcolegate avatar seabaylea avatar skehlet avatar tobespc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appmetrics-statsd's Issues

New Release?

The docs mentioned hot-shots, and I kept configuring the module with a config for that (with telegraf: true) thinking why it is not working.

Had to look at the source to find out that the release on npm does not match the latest commit.

Monitoring multiple hosts

Hi,

It seems like if we need to monitor multiple servers, all metrics will be jumbled together, because there is no separtation key ( hostname? ). There will be no way to drill down into individual servers in graphite with the way mertics are named.

Also question about cluster mode, if we are running with pm2 in cluster mode with let say 8 node instances, will it send metrics for each node process, or only from master process?

Cannot configure appmetrics

We want to use appmetrics-statsd and want to configure appmetrics to disable mqtt. I can't seem to do this currently when initialising the appmetrics-statsd library.

Ideally it would be nice to have two types of config objects passed into the appmetrics-statsd library so that both appmetrics and statsd can be configured. We are happy to raise a PR for this, but want to find out if this project is still maintained as there seem to be a PR that has been opened since early May.

Is this repo still maintained?

Hi,

I was wondering whether this project is still maintained, as it is now 2 major versions behind appmetrics?

Is there any plan to update it or is it a case of raising a PR?

Replace node-statsd with hot-shots.

node-statsd[1] hasn't seen any maintenance in a little over 4 years at this point, and hasn't seen any real responses to Issues or Pull Requests during that time.

In the interim, hot-shots[2] forked off from node-statsd and has been consistently maintained and extended to support statsd-like offerings from Datadog and Telegraf.

I'm not saying that node-statsd isn't working (it is), however hot-shots has maintained API compatibility with node-statsd and offers users more features and options, and a greater likelihood of any bugs that may arise being fixed in a more timely manner.

[1] https://github.com/sivy/node-statsd
[2] https://github.com/brightcove/hot-shots

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.