chronos-microservice-debugger3

2.0.3 • Public • Published

Chronos logo

Chronos

Microservice communication and health visualizer.

NPM Version NPM Downloads

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 installcommand:

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:

  1. microserviceName: To identify the microservice (i.e. "payments")
  2. databaseType: Enter either "mongo" or "sql"
  3. databaseURL: Enter the URL of your database
  4. wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no"
  5. 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:password@cluster0-abc.mongodb.net/','yes','h'))

Array parameter example:

let values = [
  'payments',
  'mongo',
  'mongodb+srv://user:password@cluster0-abc.mongodb.net/',
  '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

License

MIT

Package Sidebar

Install

npm i chronos-microservice-debugger3

Weekly Downloads

0

Version

2.0.3

License

MIT

Unpacked Size

22 kB

Total Files

10

Last publish

Collaborators

  • chronosjobtc