You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,14 @@ Chronos welcomes all pull requests.
13
13
5. Make sure code is formatted with `prettier` and follows the [Airbnb React/JSX Style Guide](https://github.com/airbnb/javascript/blob/master/react/README.md).
14
14
6. Create a pull request to `master`.
15
15
16
+
## Getting started
17
+
-`npm run bot`: Run Node and Electron at the same time to start Chronos app
18
+
- To make changes to codebase on the Main Process
19
+
- Files in the main process must be compiled prior to starting the app
20
+
- In the terminal un Chronos directory, input `tsc` to comile typescript files
21
+
- Once compiled, `npm run both`
22
+
* Note** If typescript is not installed, `npm install -g typescript`
23
+
16
24
## Issues
17
25
18
26
Please do not hesitate to file issues. Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
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.
18
18
19
19
## Table of Contents
20
-
20
+
-[New-Features](#new-feature)
21
21
-[Features](#features)
22
22
-[Demo](#demo)
23
23
-[Installation](#installation)
@@ -34,18 +34,31 @@ Chronos is a comprehensive developer tool that monitors the health and web traff
- Dark and Light mode options now available across user sessions.
49
+
- Updated charts to now also support gRPC calls
50
+
- Integrated log to provide users with relational data on request & response cycle
51
+
52
+
- Bug Fixes
53
+
- Fixed bug where users could only connect to one MongoDB databsae adn would see its microservices listed even when uesrs clicked on apllications using other MongoDb databases
54
+
55
+
- Chronos now support monitoring for gRPC!
56
+
- Distributed tracing across network request
57
+
- Currently chronos gRPC tracing for Mongodb and PostgresQL
58
+
59
+
## Ver 6.0 Features
46
60
47
61
- Distributed tracing enabled across microservices applications
48
-
- Supports <ahref="#"><imgsrc="./app/assets/http-logo-color.png"alt="HTTP"title="HTTP"align="center"height="20" /></a> protocol, with <imgsrc="./app/assets/grpc-logo-color.png"alt="gRPC"title="gRPC"align="center"height="20" /></a> _coming soon_
49
62
- Compatible with <imgsrc="./app/assets/graphql-logo-color.png"alt="GraphQL"title="GraphQL"align="center"height="20" /></a>
- Supports <ahref="#"><imgsrc="./app/assets/postgres-logo-color.png"alt="PostgreSQL"title="PostgreSQL"align="center"height="20" /></a> and <imgsrc="./app/assets/mongo-logo-color.png"alt="MongoDB"title="MongoDB"align="center"height="20" /></a> databases
@@ -87,7 +100,7 @@ To use Chronos in your existing application, download and install the following
87
100
npm install chronos-tracker
88
101
```
89
102
90
-
### Configure Chronos
103
+
### Configure Chronos for REST or gRPC
91
104
92
105
Similarly, in the **root directory** of _each of your microservice applications_, create a `chronos-config.js` file with properties listed below:
93
106
@@ -101,6 +114,7 @@ chronos.use({
101
114
interval:2000,
102
115
dockerized:true,
103
116
database: {
117
+
connection:'REST',
104
118
type:'MongoDB',
105
119
URI:process.env.MONGO_URI,
106
120
},
@@ -115,6 +129,7 @@ The `interval` property is optional and takes in an integer. This controls the C
115
129
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.
116
130
117
131
The `database` property is required and takes in the following:
132
+
-`connection` which should be a string and only supports 'REST' and 'gRPC'
118
133
-`type` which should be a string and only supports 'MongoDB' and 'PostgreSQL'.
119
134
-`URI` which should be a connection string the database you intend Chronos to write and record data regarding health, HTTP route tracing, and container infomation to. A `.env` is recommended.
120
135
@@ -126,14 +141,15 @@ The `notifications` property is optional. Jump to the section below, [Notificati
126
141
<br>
127
142
<br>
128
143
129
-
### Initialize Chronos
144
+
### Initialize Chronos for REST
130
145
131
146
Wherever you create an instance of your server (see example below),
132
147
133
148
```js
134
-
// Example
149
+
// Example for REST
135
150
constexpress=require('express');
136
151
constapp=express());
152
+
137
153
```
138
154
139
155
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.
You should be good to go! The last step, **Docker Configuration**, is **only applicable** if you need to configure <ahref="#"><imgsrc="./app/assets/docker-logo-color.png"alt="Docker"title="Docker"align="center"height="20" /></a> for your application.
168
+
152
169
<br>
153
170
171
+
172
+
### Initialize Chronos for gRPC
173
+
174
+
Wherever you create an instance of your server (see example below),
For any request you wish to trace, require uuidv4 and write the following code where the initial gRPC request begins,
240
+
```js
241
+
constrequire { v4:uuidv4} =require('uuid')
242
+
constcreateMeta= () => {
243
+
constmeta=newgrpc.Metadata();
244
+
meta.add('id', uuidvd());
245
+
return meta
246
+
}
247
+
```
248
+
and then invoke createMeta as a third argument to any client method that is the beginning of the request path.
249
+
250
+
```js
251
+
orderClient.AddOrder(
252
+
order,
253
+
(err, data) => {
254
+
if (err !==null) {
255
+
console.log(err);
256
+
// could not add order because bookID does not exist
257
+
returnres.sendStatus(404);
258
+
}
259
+
console.log('addOrder response: ', data);
260
+
returnres.sendStatus(200);
261
+
},
262
+
createMeta()
263
+
);
264
+
265
+
```
266
+
Finally, on all servers that will be involved in the request path, invoke `chronos.link` with parameters of `client` and `ServerWrapper` in the server wrapper.
267
+
268
+
```js
269
+
chronos.link(client, ServerWrapper);
270
+
```
271
+
154
272
### Docker Configuration
155
273
156
274
Again, this step is **only applicable** if you are currently using <ahref="#"><imgsrc="./app/assets/docker-logo-color.png"alt="Docker"title="Docker"align="center"height="20" /></a> containers for your microservices.
@@ -266,9 +384,9 @@ Refer to the [README](link) in the `docker` folder for more details.
266
384
267
385
<br>
268
386
269
-
### Middleware Branch
387
+
### gRPC Branch
388
+
The **'gRPC'** branch is the current codebase for the <ahref="#"><imgsrc="./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 <ahref="#"><imgsrc="./app/assets/npm-logo-color.png"alt="NPM"title="NPM"align="center"height="20" /></a> package [here](https://www.npmjs.com/package/chronos-tracker).
270
389
271
-
The **'middleware'** branch is the current codebase for the <ahref="#"><imgsrc="./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 <ahref="#"><imgsrc="./app/assets/npm-logo-color.png"alt="NPM"title="NPM"align="center"height="20" /></a> package [here](https://www.npmjs.com/package/chronos-tracker).
272
390
<br>
273
391
274
392
#
@@ -286,7 +404,7 @@ The **'middleware'** branch is the current codebase for the <a href="#"><img src
Microservices architecture for testing [Chronos](https://github.com/oslabs-beta/Chronos), a microservice communication and health visualizer.
4
+
5
+
## Purpose and Design
6
+
This sample microservices architecture allows developers to explore the functionality of Chronos with gRPC calls. It consists of 3 microservices, which are contained within the directories:
7
+
- Reverse Proxy
8
+
- Books
9
+
- Orders
10
+
11
+
Each microservice has its own server, which receives requests from both the client and from other microservices. Books, Customers, and Orders also have their own databases, which they can query to respond to those requests.
12
+
13
+
## Getting Started w/ gRPC Example Microservices
14
+
15
+
Follow **'main'** branch READ>ME steps: Pre-Installation, Install Dependencies before start.
16
+
17
+
On each microservice in example/microserivces, perform the following steps
18
+
-*Do this for microservices: books, orders, & reverse proxy
19
+
- Install dotenv `npm install dotenv`
20
+
- Create a .env file across each ,microservices and input your own Mongodb Atlast URI for both Microservice_URI and CHRONOS_URI
21
+
-** Reverse Proxy .env file will only require CHRONOS_URI
- In each Microservice Mode.js file import and set the Microservice_URI
29
+
30
+
```
31
+
const myURI = process.env.BOOK_URI;
32
+
33
+
```
34
+
35
+
- In each of the chronos-config.js files, import and set URI property in database to the Chronos_URI as shown
36
+
37
+
```
38
+
require('dotenv').config();
39
+
const chronos = require('chronos-tracker');
40
+
41
+
chronos.use({
42
+
microservice: 'name of microservice e.g books or orders',
43
+
interval: 2000,
44
+
database: {
45
+
type: 'MongoDB'
46
+
URI: process.env.CHRONOS_URI
47
+
},
48
+
notifications: [],
49
+
})
50
+
```
51
+
-**Note: The Initialize Chronos step is already taken care of for you.
52
+
- Run `npm run start` in each folder directory
53
+
- To do so, within each microservice directory, install all dependencies using the `npm install`
54
+
- Head over to localhost:3030 to view reverse proxy acting as the frontend of this microservice example
55
+
- Start adding data!
56
+
- Run `npm run both` to start Electron app
57
+
- Add a new application in Chronos app dashboard.
58
+
- The URI should be your CHRONOS_URI
59
+
60
+
61
+
**To test the functionality of Chronos using this sample microservices architecture, you must install the [Chronos node module](https://www.npmjs.com/package/chronos-microservice-debugger3) within each microservice. _It is not pre-installed._ Installation instructions for both the Chronos node module and the Chronos desktop visualizer are below:**
62
+
63
+
64
+
#### Electron desktop application
65
+
66
+
After installing the node module in each microservice, download the Electron desktop application from the public [Chronos](https://github.com/oslabs-beta/Chronos) repo.
67
+
68
+
Inside the downloaded directory, install all dependencies using the `npm install` command followed by the `npm run both` command to start the Electron desktop application.
69
+
70
+
## Contributing
71
+
72
+
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
Copy file name to clipboardExpand all lines: examples/microservices/README.md
+48-4Lines changed: 48 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,53 @@ This sample microservices architecture allows developers to explore the function
11
11
12
12
Each microservice has its own server, which receives requests from both the client and from other microservices. Books, Customers, and Orders also have their own databases, which they can query to respond to those requests.
13
13
14
-
**You must replace the placeholder MongoDB Atlas URIs for the databases with your own _actual_ MongoDB Atlas URIs:**
14
+
## Getting Started w/ gRPC Example Microservices
15
+
16
+
Follow **'main'** branch READ>ME steps: Pre-Installation, Install Dependencies before start.
17
+
18
+
On each microservice in example/microserivces, perform the following steps
19
+
-*Do this for microservices: books, orders, & reverse proxy
20
+
- Install dotenv `npm install dotenv`
21
+
- Create a .env file across each ,microservices and input your own Mongodb Atlast URI for both Microservice_URI and CHRONOS_URI
22
+
-** Reverse Proxy .env file will only require CHRONOS_URI
microservice: 'name of microservice e.g books or orders',
44
+
interval: 2000,
45
+
database: {
46
+
type: 'MongoDB'
47
+
URI: process.env.CHRONOS_URI
48
+
},
49
+
notifications: [],
50
+
})
18
51
```
52
+
-**Note: The Initialize Chronos step is already taken care of for you.
53
+
- Run `npm run start` in each folder directory
54
+
- To do so, within each microservice directory, install all dependencies using the `npm install`
55
+
- Head over to localhost:3000 to view reverse proxy acting as the frontend of this microservice example
56
+
- Start adding data!
57
+
- Run `npm run both` to start Electron app
58
+
- Add a new application in Chronos app dashboard.
59
+
- The URI should be your CHRONOS_URI
19
60
20
-
In order to start the entire application, you will need to start each microservice's server. To do so, within each microservice directory, install all dependencies using the `npm install` command followed by the `npm start` command. You will then be able to interact with the application (as though you are a user) on a barebones frontend, which is being served by the Reverse Proxy server and can be found at localhost:3000.
21
61
22
62
**To test the functionality of Chronos using this sample microservices architecture, you must install the [Chronos node module](https://www.npmjs.com/package/chronos-microservice-debugger3) within each microservice. _It is not pre-installed._ Installation instructions for both the Chronos node module and the Chronos desktop visualizer are below:**
After installing the node module in each microservice, download the Electron desktop application from the public [Chronos](https://github.com/oslabs-beta/Chronos) repo.
86
126
87
-
Inside the downloaded directory, install all dependencies using the `npm install` command followed by the `npm start` command to start the Electron desktop application.
127
+
Inside the downloaded directory, install all dependencies using the `npm install` command followed by the `npm run both` command to start the Electron desktop application.
88
128
89
129
## Contributing
90
130
91
131
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
0 commit comments