# pm2-ant **Repository Path**: mirrors_esvit/pm2-ant ## Basic Information - **Project Name**: pm2-ant - **Description**: :ant: Unitech/PM2 performance monioring using Statsd and Graphite - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pm2-ant Unitech/PM2 performance monioring using Statsd and Graphite # Installation ```bash $ npm install pm2-ant -g $ pm2-ant [options] # or $ npm install pm2-ant --production $ cd node_modules/pm2-ant # or $ git clone https://github.com/Tjatse/pm2-ant.git $ cd pm2-ant $ npm install --production $ pm2-ant [options] ``` ## Why this? I'm using PM2 to run thousands applications on dozens of servers, the performance of PM2 (maybe applications) is hard to track on production environment, e.g.: - [x] Restart, stop, start events of PM2 - [x] CPU & Memory usages (collectd) - [ ] I/O frequency - [ ] Network latency (Request / Response times, Apdex stuffs) - [ ] Triggers (restart / stop warning - SMS / Email) ## How it works ![flows](imgs/flows.jpg) ## Requirement - [Graphite](docs/graphite.md) - [StatsD](docs/statsd.md) - [collectd](docs/collectd.md) *(optional)* ## Usage When the carbon and statsd are both running, just edit the `pm2-ant.ini` file to make everything goes fine, then use the following commands to get usage helps: ```bash $ pm2-ant ``` Directly: ```bash $ node pm2-ant.js ``` Programmable: ```javascript var pm2Ant = require('pm2-ant'); pm2Ant.start([options]); ``` ## View Matrices Now you can view matrices with [Grafana](http://docs.grafana.org/installation/rpm/). ![flows](imgs/grafana.jpg) statsD path: ``` stats.gauges.pm2...planned_restart_count stats.gauges.pm2....planned_restart_count stats.gauges.pm2...unstable_restart_count stats.gauges.pm2....unstable_restart_count stats.pm2...event. stats.pm2....event. stats.timers.pm2...uptime stats.timers.pm2....uptime ``` ## Configuration `./pm2-ant.ini` defaults: ```ini node = LocalPM2 pm2 = ~/.pm2 refresh = 5000 statsd = 127.0.0.1:8125 daemonize = true [log] dir = ./logs prefix = true date = false level = debug ``` ## Changelogs # 0.1.4-beta - fix SyntaxError: Unexpected token [#3](https://github.com/Tjatse/pm2-ant/pull/3) @xiilei # 0.1.4-alpha - Keep pace with [pm2-gui](/Tjatse/pm2-gui) ## License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.