Skip to content

Commit c07a052

Browse files
authored
Merge pull request #189 from open-source-labs/james/npm-readme
Chronos 7 Launch PR
2 parents 6cf3b59 + 7227193 commit c07a052

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4045
-8107
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# JS Project-Specific #
22
#######################
3-
node_modules
3+
# node_modules
44
dist
55
build
66
release-builds
77
coverage
88
__tests__/**/__snapshots__
9-
# .env
9+
.env
1010
users.json
1111
test_users.json
1212

@@ -46,4 +46,5 @@ test_users.json
4646
.Spotlight-V100
4747
.Trashes
4848
ehthumbs.db
49-
Thumbs.db
49+
Thumbs.db
50+
node_modules

.vscode/launch.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Electron: Main",
8+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
9+
"runtimeArgs": [
10+
"--remote-debugging-port=9223",
11+
"."
12+
],
13+
"windows": {
14+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
15+
}
16+
},
17+
{
18+
"name": "Electron: Renderer",
19+
"type": "chrome",
20+
"request": "attach",
21+
"port": 9223,
22+
"webRoot": "${workspaceFolder}",
23+
"timeout": 30000,
24+
"url": "http://localhost:8080/",
25+
}
26+
],
27+
"compounds": [
28+
{
29+
"name": "Electron: All",
30+
"configurations": [
31+
"Electron: Main",
32+
"Electron: Renderer"
33+
]
34+
}
35+
]
36+
}

README.md

Lines changed: 80 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Chronos is a comprehensive developer tool that monitors the health and web traff
2525
- [Configure Chronos Tracker](#configure-chronos-tracker)
2626
- [Initialize Chronos Tracker](#initialize-chronos-tracker)
2727
- [Docker Configuration](#docker-configuration)
28+
- [Kafka Configuration](#Apache-Monitoring-(Via-JMX-to-Prometheus-Exporter))
2829
- [Start Chronos](#start-chronos)
2930
- [Getting the Executable](#getting-the-chronos-executable)
3031
- [Notifications](#notifications)
@@ -46,36 +47,39 @@ Chronos is a comprehensive developer tool that monitors the health and web traff
4647

4748
## <img src ="./app/assets/fire.png" height=22 > What's New? <img src ="./app/assets/fire.png" height=24>
4849

49-
- New Feature
50-
- Chronos now comes in any OS .exe!
51-
- Overhauled Features
52-
- Authentication Enabling with Bcrypt
53-
- Stand-up times decreased
54-
- Side-by-side Server Comparisons
55-
- Color-hashing generates unique colors for each server connection
56-
- Improved navigation bar and buttons
57-
- Increased overall speed and responsiveness
58-
- Updated Features
59-
- Added React Testing Library
60-
- Removed Spectron and Enzyme
61-
- Added testing suites for unit, integration, and end-to-end testing
62-
- Refactored components for dependency injection
63-
- Bug Fixes
64-
- Authentication now functioning properly
50+
51+
- Metric query tool so you can filter out specific metrics — now you only have to see what you want on the dashboard.
52+
- Additional metrics added, bringing Chronos up from only 12 to 100+ metrics that are currently available
53+
- Option to filter by category and individual metric, and flip between services and categories with ease
54+
- Apache Kafka monitoring capability, all you need to do is run Prometheus JMX exporter on the system your Chronos application is running on. A sample JMX config.yaml file is provided in the Chronos repository for a quick and easy setup, however you are free to configure however you like.
55+
- Bug fixes and UI tweaks — Chronos is now a more seamless experience than ever.
56+
6557
## Features
6658

6759
- Distributed tracing enabled across microservices applications
6860
- Compatible with <img src="./app/assets/graphql-logo-color.png" alt="GraphQL" title="GraphQL" align="center" height="20" /></a>
6961
- 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
7062
- Displays real-time temperature, speed, latency, and memory statistics
7163
- Display and compare multiple microservice metrics in a single graph
64+
- Monitor an <a href="#"><img src="./app/assets/pngwing.com.png" alt="Apache Kafka" title="Apache Kafka" align="center" height="20" /></a> cluster via the JMX Prometheus Exporter
65+
7266
#
7367
###### Return to [Top](#chronos)
7468
<br>
7569

7670
## Demo
77-
71+
<br>
72+
<br>
73+
Signing Up
74+
<br>
75+
<br>
7876
<a href="#"><img src="./app/assets/enable_sign_up.gif" alt="Chronos-Demo" title="Chronos-Demo" align="center" height="500" /></a></a>
77+
<br>
78+
<br>
79+
Using the Query Tool
80+
<br>
81+
<br>
82+
<a href="#"><img src="./app/assets/query_tool.gif" alt="Query-Tool-Demo" title="Query-Tool-Demo" align="center" height="475" /></a></a>
7983

8084
#
8185
###### Return to [Top](#chronos)
@@ -84,8 +88,8 @@ Chronos is a comprehensive developer tool that monitors the health and web traff
8488
## Installation
8589
This is for the latest Chronos version **5.2 release and later**.
8690

87-
- Stable release: 6.1.0
88-
- LTS release: 6.1.0
91+
- Stable release: 7.0.0
92+
- LTS release: 7.0.0
8993

9094
### Pre-Installation
9195
Make sure you're running version 14.16.1 of <a href="#"><img src="./app/assets/node-logo-color.png" alt="Node" title="Node" align="center" height="20" /></a></a>, which is the most recent LTS (long-term support) version.
@@ -119,22 +123,22 @@ export DISPLAY="`sed -n 's/nameserver //p' /etc/resolv.conf`:0"
119123

120124
To use Chronos in your existing application, download and install the following in the **root directory** of _each of your microservice applications_:
121125
```
122-
npm install chronos-tracker
126+
npm install chronos-tracker-7
123127
```
124128

125-
### Configure Chronos Tracker
129+
### Configuring Chronos Tracker
126130

127131
Similarly, in the **root directory** of _each of your microservice applications_, create a `chronos-config.js` file with properties listed below:
128132

129133
```js
130134
// A sample `chronos-config.js` file
131135

132-
const chronos = require('chronos-tracker');
136+
const chronos = require('chronos-tracker-7');
133137

134138
chronos.use({
135139
microservice: 'payments',
136140
interval: 5000,
137-
dockerized: true,
141+
dockerized: true, // <-- The 'dockerized' property is optional
138142
database: {
139143
connection: 'REST',
140144
type: 'MongoDB',
@@ -153,45 +157,31 @@ The `dockerized` property is optional and should be specified as `true` if the s
153157
The `database` property is required and takes in the following:
154158
- `connection` should be a string and only supports 'REST' and 'gRPC'
155159
- `type` should be a string and only supports 'MongoDB' and 'PostgreSQL'.
156-
- `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.
157-
158-
_NOTE: A `.env` is recommended._
160+
- `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.
161+
We reccommend using dotenv
159162

160-
<!-- - `isDockerized`: Is this microservice running in a Docker container? Enter `yes` or `no`. The current default setting is `no`.
161-
- <img src="./app/assets/important.png" alt="Important" title="Important" align="center" height="20" /></a> When starting up the container, give it the same name that you used for the microservice, because the middleware finds the correct container ID of your container by matching the container name to the microservice name you input as 1st argument.
162-
- <img src="./app/assets/important.png" alt="Important" title="Important" align="center" height="20" /></a> Don't forget to bind mount to Docker socket. -->
163-
164-
The `notifications` property is optional. Jump to the section below, [Notifications](#notifications) to configure <a href="#"><img src="./app/assets/slack-logo-color.png" alt="Slack" title="Slack" align="center" height="20" /></a> or email <a href="#"><img src="./app/assets/email-icon-black.png" alt="Slack" title="Slack" align="center" height="20" /></a> notifications.
165-
<br>
166-
<br>
167-
168-
### Initialize Chronos Tracker
169-
#### Initialize Chronos Tracker for REST
170-
171-
Wherever you create an instance of your server (see example below),
163+
You will also need to add the following two lines of code to your express server:,
172164

173165
```js
174166
// Example for REST
175167
const express = require('express');
176-
const app = express());
168+
const app = express();
177169

178170
```
179171

180-
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.
172+
you will also need to require in `chronos-tracker-7` and initialize Chronos, as well as the `./chronos-config` file in addition to implementing `chronos.track()` for all endpoints.
181173

182174
```js
183-
const chronos = require('chronos-tracker');
175+
const chronos = require('chronos-tracker-7');
184176
require('./chronos-config'); // Bring in config file
185177

186178
// ...
187179

188-
chronos.propagate();
189180
app.use('/', chronos.track());
190181
```
191182

192-
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.
183+
You should be good to go! The steps below for **Docker Configuration** and **Kafka Configuration**, are **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> or Kafka for your application. See the **Notifications** section below for information on how to uses the notifications propery in `chronos-config.js`.
193184

194-
<br>
195185

196186

197187
#### Initialize Chronos Tracker for gRPC
@@ -214,7 +204,7 @@ you will also need to require Chronos-tracker, Chronos-config, and dotenv.config
214204

215205
```js
216206
//track health data
217-
const chronos = require('chronos-tracker');
207+
const chronos = require('chronos-tracker-7');
218208
require('./chronos-config');
219209
require('dotenv').config(); // set up environment variables in .env
220210
const BookModel = require('./BookModel');
@@ -317,6 +307,49 @@ volumes:
317307
- "/var/run/docker.sock:/var/run/docker.sock"
318308
```
319309

310+
311+
312+
### Apache Kafka Monitoring (Via JMX to Prometheus Exporter)
313+
314+
Chronos now offers the ability to monitor an Apache Kafka cluster via JMX to Prometheus Exporter. In order for this feature to work you must be running [JMX to Prometheus
315+
Exporter](https://github.com/prometheus/jmx_exporter) either as a Java Agent with your cluster or as a standalone HTTP server. Then, use `chronos-config.js` to specifiy the port exposed for metrics scraping.
316+
317+
To start, add the property `jmxuri` to the object in `chronos-config.js`. Your file should look similar to below. Add this property to `chronos-config.js` in ***ONE AND ONLY ONE** of your microservices:
318+
319+
```js
320+
const chronos = require('chronos-tracker-7');
321+
322+
chronos.use({
323+
microservice: 'payments',
324+
interval: 5000,
325+
dockerized: true,
326+
jmxuri: // your URI here
327+
database: {
328+
connection: 'REST',
329+
type: 'MongoDB',
330+
URI: process.env.URI,
331+
},
332+
notifications: [],
333+
});
334+
```
335+
The `jmxuri` property should be a string whose value is the port specified for scraping when starting the exporter.
336+
337+
Then, in ***ONE AND ONLY ONE** of your microservices, call
338+
339+
```js
340+
341+
chronos.kafka()
342+
343+
```
344+
345+
in your express server. When viewing your information in the Chronos Electron application the data will be available in the service "kafkametrics"
346+
347+
**NOTE:** We provide a config.yaml file in the Chronos root folder for use with JMX prometheus that provides some useful baseline metrics to monitor.
348+
349+
#
350+
###### Return to [Top](#chronos)
351+
<br>
352+
320353
### Start Chronos
321354

322355
Once you have configured and intialized Chronos Tracker, it will automatically record monitoring data when your servers are running. Finally, start the Chronos desktop app to view that data! After cloning our [GitHub repo](https://github.com/open-source-labs/Chronos), run `npm install` and `npm run both` to start Chronos.
@@ -417,9 +450,6 @@ Refer to the [README](link) in the `docker` folder for more details.
417450

418451
<br>
419452

420-
### gRPC Branch
421-
The **'gRPC'** branch is the current codebase for the <a href="#"><img src="./app/assets/npm-logo-color.png" alt="NPM" title="NPM" align="center" height="20" /></a> package, which is what you will install in your own application in order to use Chronos. Download the <a href="#"><img src="./app/assets/npm-logo-color.png" alt="NPM" title="NPM" align="center" height="20" /></a> package [here](https://www.npmjs.com/package/chronos-tracker).
422-
423453
## chronosWebsite
424454
This is the branch that holds the code base for the splash page. Edit the website by first running `git clone -b chronosWebsite https://github.com/open-source-labs/Chronos.git .` and then updating the aws S3 bucket with the changes.
425455

@@ -449,7 +479,8 @@ This is the branch that holds the code base for the splash page. Edit the websit
449479
- <a href="#"><img src="./app/assets/material-ui-logo-color.png" alt="Material-UI" title="Material-UI" align="center" height="30" /></a>
450480
- <a href="#"><img src="./app/assets/vis-logo-color.png" alt="Vis.js" title="Vis.js" align="center" height="30" /></a>
451481
- <a href="#"><img src="./app/assets/plotly-logo-color.png" alt="Plotly.js" title="Plotly.js" align="center" height="30" /></a>
452-
482+
- <a href="#"><img src="./app/assets/pngwing.com.png" alt="Apache Kafka" title="Apache Kafka" align="center" height="30" /></a>
483+
- <a href="#"><img src="./app/assets/AntDesign.svg" alt="Ant Design" title="Ant Design" align="center" height="30" /></a>
453484
#
454485
###### Return to [Top](#chronos)
455486
<br>

__tests__/test_settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
{"setupRequired":false,"services":[["myPostgres","SQL","postgres://zwezmnqm:[email protected]:5432/zwezmnqm","Online bookstore with that keeps track of orders and customers","Jun 28, 2020 4:58 PM"],["ToddDB","MongoDB","mongodb+srv://tdwolf6:[email protected]/Chronos?retryWrites=true&w=majority","Web app deployed on AWS","Jul 3, 2020 7:12AM"]],"mode":"dark mode","splash":true,"landingPage":"dashBoard"}
1+
{
2+
"setupRequired": false,
3+
"services": [
4+
5+
],
6+
"mode": "light mode",
7+
"splash": true,
8+
"landingPage": "dashBoard"
9+
}

app/assets/AntDesign.svg

Lines changed: 1 addition & 0 deletions
Loading

app/assets/pngwing.com 2.png

7.39 KB
Loading

app/assets/pngwing.com.png

7.39 KB
Loading

app/assets/query_tool.gif

640 KB
Loading

0 commit comments

Comments
 (0)