Monyt
Extensible Monitor and Logger for Node.js Applications
Monyt provides abstraction interfaces of monitoring and logging for Node.js Applications.
Installation
$ npm i -S monyt
Usage
Basic
monitor.js
; const interval = 60000; //default is 30000(ms) const senders = host: 'my.graphite.host.com' port: '2003' //port of plaintext protocol; const metricses = ; const monitor = interval prefix: `..` //This could be server hostname or application name or clusterId and etc. senders metricses; ;
server.js
;; const logger = monitor; monitor; const app = ;app;app;
Make your own Metrics and Sender
ProductBuyMetrics.js
; { super; thisname = 'product.buy'; thisvalue = {} } { thisvalueproductId = thisvalueproductId || 0; thisvalueproductId = thisvalueproductId + 1; }
MongoDBSender.js
; { super; thisclient = optionsdb; } { return { thisclient; }; }
monitor.js
...const productBuyMetrics = const senders = db: mongodbClient;const metricses = ;const monitor = ... senders metricses ...;;;
your-app.js
; app;
API
Change History
License
This software is free to use under the Minkyu Cho. MIT license. See the LICENSE file for license text and copyright information.
Contributing
Please don't hesitate to send a small pull-request or just leave anything you want as an issue.
- Fork it!
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request :D