|
| 1 | + # Chronos 7 |
| 2 | + |
| 3 | +Chronos is a comprehensive developer tool that monitors the health and web traffic of servers, microservices, and containers. Use Chronos to see real-time data monitoring and receive automated notifications over Slack or email. |
| 4 | + |
| 5 | +## <div height=22 > What's New? </div> |
| 6 | +- New Features |
| 7 | + - The ability to monitor an Apache Kafka cluster via the JMX Prometheus Exporter |
| 8 | + - Added 19 new system-level metrics for monitoring! |
| 9 | +- Overhauled Features |
| 10 | + - Users can use the new query tool to select the specific metrics that they would |
| 11 | + like to monitor |
| 12 | +## Features |
| 13 | +- Distributed tracing enabled across microservices applications |
| 14 | +- Compatible with <img src="./app/assets/graphql-logo-color.png" alt="GraphQL" title="GraphQL" align="center" height="20" /></a> |
| 15 | +- Supports <a href="#"><img src="./app/assets/postgres-logo-color.png" alt="PostgreSQL" title="PostgreSQL" align="center" height="20" /></a> and <img src="./app/assets/mongo-logo-color.png" alt="MongoDB" title="MongoDB" align="center" height="20" /></a> databases |
| 16 | +- Displays real-time temperature, speed, latency, and memory statistics |
| 17 | +- Display and compare multiple microservice metrics at once |
| 18 | +- Monitor an Apache Kafka cluster via the JMX Prometheus Exporter |
| 19 | +# |
| 20 | +## Installation |
| 21 | + |
| 22 | +To use Chronos in your existing application, download and install the following in the **root directory** of _each of your microservice applications_: |
| 23 | +``` |
| 24 | +npm install chronos-tracker-7 |
| 25 | +``` |
| 26 | + |
| 27 | +### Pre-Installation |
| 28 | +Make sure you're running version 14.16.1 of, which is the most recent LTS (long-term support) version. |
| 29 | + |
| 30 | +If you need to roll back from <a href="#"><img src="./app/assets/node-logo-color.png" alt="Node" title="Node" align="center" height="20" /></a> 16.1.0, make sure to run |
| 31 | +```npm rebuild``` |
| 32 | +in the root directory. |
| 33 | + |
| 34 | + |
| 35 | +<br> |
| 36 | + |
| 37 | +### Configuring Chronos Tracker |
| 38 | + |
| 39 | +Similarly, in the **root directory** of _each of your microservice applications_, create a `chronos-config.js` file with properties listed below: |
| 40 | + |
| 41 | +```js |
| 42 | +// A sample `chronos-config.js` file |
| 43 | + |
| 44 | +const chronos = require('chronos-tracker-7'); |
| 45 | + |
| 46 | +chronos.use({ |
| 47 | + microservice: 'payments', |
| 48 | + interval: 5000, |
| 49 | + dockerized: true, |
| 50 | + database: { |
| 51 | + connection: 'REST', |
| 52 | + type: 'MongoDB', |
| 53 | + URI: process.env.URI, |
| 54 | + }, |
| 55 | + notifications: [], |
| 56 | +}); |
| 57 | +``` |
| 58 | + |
| 59 | +The `microservice` property takes in a string. This should be the name of your server or microservice. For **Docker** containers, the name of the microservice should be the same as the name of the corresponding Docker container. |
| 60 | + |
| 61 | +The `interval` property is optional and takes in an integer. This controls the Chronos monitoring frequency. If this is omitted, Chronos will default to recording server health every 60000 ms or 60 seconds. |
| 62 | + |
| 63 | +The `dockerized` property is optional and should be specified as `true` if the server is running inside of a Docker container. Otherwise, this should be `false`. If omitted, Chronos will assume this server is not running in a container. |
| 64 | + |
| 65 | +The `database` property is required and takes in the following: |
| 66 | +- `connection` should be a string and only supports 'REST' and 'gRPC' |
| 67 | +- `type` should be a string and only supports 'MongoDB' and 'PostgreSQL'. |
| 68 | +- `URI` should be a connection string to the database where you intend Chronos to write and record data regarding health, HTTP route tracing, and container infomation. |
| 69 | +We reccommend using dotenv |
| 70 | + |
| 71 | +Wherever you create an instance of your server (see example below), |
| 72 | + |
| 73 | +```js |
| 74 | +// Example for REST |
| 75 | +const express = require('express'); |
| 76 | +const app = express(); |
| 77 | + |
| 78 | +``` |
| 79 | + |
| 80 | +you will also need to require in `chronos-tracker` and initialize Chronos, as well as the `./chronos-config` file. You will then need to invoke `chronos.propagate()` to initiate the route tracing, in addition to implementing `chronos.track()` for all endpoints. |
| 81 | + |
| 82 | +```js |
| 83 | +const chronos = require('chronos-tracker'); |
| 84 | +require('./chronos-config'); // Bring in config file |
| 85 | + |
| 86 | +// ... |
| 87 | + |
| 88 | +app.use('/', chronos.track()); |
| 89 | +``` |
| 90 | + |
| 91 | +You should be good to go! The last step, **Docker Configuration**, is **only applicable** if you need to configure <a href="#"><img src="./app/assets/docker-logo-color.png" alt="Docker" title="Docker" align="center" height="20" /></a> for your application. |
| 92 | + |
| 93 | +<br> |
0 commit comments