chronos-microservice-debugger3
v2.0.3
Published
Microservice communication and health visualizer.
Downloads
4
Maintainers
Readme
Chronos
Microservice communication and health visualizer.
const cmd = require('chronos-microservice-debugger3')
cmd.propagate()
app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))
Features
- HTTP request tracing
- Speed and latency tracking
- Process monitoring
- Memory usage
Installation
Chronos consists of a Node module available through the npm registry and a lightweight Electron desktop application.
Node module
To begin, install the Chronos node module within each microservice of your application using the
npm install
command:
npm install chronos-microservice-debugger3
Once installed, write the following two lines at the top of each microservice's server file:
const cmd = require('chronos-microservice-debugger3');
cmd.propagate();
Then add a route handler for all incoming requests:
app.use('/', cmd.microCom('microserviceName', 'databaseType', 'databaseURL', 'wantMicroHealth', 'queryFrequency'))
The cmd.microCom handler function logs communication and health data to a user-provided database. This is to ensure that your private data stays private. We currently support MongoDB and SQL/PostgreSQL databases.
cmd.microCom takes four parameters and an optional fifth parameter. You can enter the arguments as individual strings or as an array.
The parameters are:
- microserviceName: To identify the microservice (i.e. "payments")
- databaseType: Enter either "mongo" or "sql"
- databaseURL: Enter the URL of your database
- wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no"
- queryFrequency (optional): How frequently do you want to log the health of this microservice? It defaults to every minute, but you can choose:
- "s" : every second
- "m" : every minute (default)
- "h" : every hour
- "d" : once per day
- "w" : once per week
String parameter example:
app.use('/', cmd.microCom('payments', 'mongo', 'mongodb+srv://user:[email protected]/','yes','h'))
Array parameter example:
let values = [
'payments',
'mongo',
'mongodb+srv://user:[email protected]/',
'yes',
'h'
]
app.use('/', cmd.microCom(values)
Electron desktop application
After installing the node module in each microservice, download the Electron desktop application from the public Chronos repo.
Inside the downloaded directory, install all dependencies using the npm install
command followed by the npm start
command to start the Electron desktop application.
Contributing
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
People
Tim Atapagra, Mohtasim Chowdhury, Ousman Diallo, Michelle Herrera, Duane McFarlane, Ben Mizel, Jenae Pennie, Chris Romano, Natalie Umanzor