Skip to content

Commit 92ba041

Browse files
committed
further linked NPM README to examples, added screenshoots for docker example, revised npm package README
1 parent d958497 commit 92ba041

File tree

13 files changed

+110
-63
lines changed

13 files changed

+110
-63
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ We provide eight example applications for you to test out both the Chronos NPM p
129129
- Kubernetes
130130
- [Kubernetes README](./examples/kubernetes/README.md)
131131
- Microservices
132-
- [microservices README](./examples/microservices/README.md)
132+
- [Microservices README](./examples/microservices/README.md)
133133

134+
Additional documentation on how Chronos is used **in each example** can be found in the [Chronos NPM Package README](./chronos_npm_package/README.md).
134135

135136
#### _AWS_
136137

@@ -175,9 +176,15 @@ In the `microservices` folder, we provide a sample microservice application that
175176
Refer to the [microservices README](./examples/microservices/README.md) in the `microservices` folder for more details.
176177
#
177178

179+
# Testing
180+
181+
We've created testing suites for Chronos with React Testing and Jest - instructions on running them can be found in the [testing README](./__tests__/README.md).
182+
#
178183
## Contributing
179184

180-
Development of Chronos is open source on GitHub through the tech accelerator umbrella OS Labs, and we are grateful to the community for contributing bug fixes and improvements. Read our [contributing README](https://github.com/oslabs-beta/Chronos/blob/master/CONTRIBUTING.md) to learn how you can take part in improving Chronos.
185+
Development of Chronos is open source on GitHub through the tech accelerator OS Labs, and we are grateful to the community for contributing bug fixes and improvements.
186+
187+
Read our [contributing README](../../CONTRIBUTING.md) to learn how you can take part in improving Chronos.
181188

182189
### **Last Iterating Team**
183190

@@ -216,8 +223,7 @@ Development of Chronos is open source on GitHub through the tech accelerator umb
216223

217224
## License
218225

219-
Chronos is [MIT licensed.](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
220-
226+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
221227
#
222228

223229
###### Return to [Top](#chronos)

__tests__/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
1. React Testing Library versions 13+ require React v18. If your project uses an older version of React, be sure to install version 12
66
```
77
npm install --save-dev @testing-library/react@12
8-
98
```
109
2. install additional packages
1110
```
@@ -55,12 +54,9 @@ module.exports = {
5554

5655
6. use `npm run test` to run jest tests
5756

58-
### Contributing
57+
## Contributing
5958

6059
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
6160

62-
### People
63-
[Snow X. Bai](https://github.com/xueapp)
64-
[Taylor Zhang](https://github.com/taylrzhang)
65-
[Tim Lee](https://github.com/timlee12)
66-
[Roberto Meloni](https://github.com/RobertoRueMeloni)
61+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
62+

assets/examples_docker_data.png

37.7 KB
Loading

assets/examples_docker_removed.png

38 KB
Loading

assets/examples_docker_stop.png

38.2 KB
Loading

chronos_npm_package/README.md

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# Chronos
2-
Visit our splash page at [chronoslany.com](https://chronoslany.com/)
3-
4-
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.
5-
6-
#
7-
81
## What's New?
92
- Bug Fixes
103
- Refactored code for additional modularity and customization
114
- Ability for developers to increase number of metrics monitored for microservices
12-
135
#
146

157
## Features
@@ -32,7 +24,6 @@ Install the package as a dependency in each of the microservices you want to tra
3224
npm install @chronosmicro/tracker
3325
```
3426

35-
<br>
3627

3728
### Configuring Chronos Tracker
3829
Create a `.js` Chronos configuration file (hereby referred to as `chronos-config.js`), which exports a JavaScript object with required Chronos configuration parameters. This object will be used as the sole Chronos class constructor argument. Feel free to use a `.env` file to hold sensitive parameters like the database URI, for example.
@@ -79,7 +70,6 @@ const Chronos = require('@chronosmicro/tracker');
7970
const chronos = new Chronos(chronosConfig);
8071
```
8172

82-
<br>
8373

8474
#### Chronos Configuration Parameters
8575
_See mode-specific configuration descriptions in the "Chronos Tracker for Microservices" section_
@@ -141,14 +131,13 @@ Chronos provides the option to send emails. The properties that should be provi
141131
- `user` - The email address (string) of the sender
142132
- `password` - The password (string) of the sender email
143133

144-
_NOTE: Email notification settings may require alternative security settings to work_
145134

146-
<br>
135+
**NOTE: Email notification settings may require alternative security settings to work**
147136

148137
### Chronos Tracker for "Microservices" Mode
149138
The mode `microservices` uses the additional setting `dockerized`, which indicates whether or not the microservice has been containerized with Docker. If omitted, Chronos will assume this server is not running in a container, i.e. `dockerized` will default to _false_.
150139

151-
Setting the flag to _false_ will collect metrics from the host computer directly, while _true_ indicates for Chronos to pull metrics from the Docker daemon.
140+
Setting the flag to `false` will collect metrics from the host computer directly, while `true` indicates for Chronos to pull metrics from the Docker daemon.
152141

153142
```js
154143
// Excerpt from a chronos-config.js
@@ -172,7 +161,9 @@ const chronos = new Chronos(chronosConfig);
172161
chronos.track()
173162
```
174163

175-
If you are using an Express.js REST API, calling `Chronos.track()` returns middleware that allows users to track incoming network requests and outgoing their corresponding outgoing responses by marking them with unique IDs using `Chronos.propagate`. If you want to utilize this feature, setup a catchall route that will serve as a pass through for tracking and chain in the middleware from `Chronos.track`.
164+
If you are using an Express.js REST API, calling `Chronos.track()` returns middleware that allows users to track incoming network requests and outgoing their corresponding outgoing responses by marking them with unique IDs using `Chronos.propagate`.
165+
166+
If you want to utilize this feature, setup a catchall route that will serve as a pass through for tracking and chain in the middleware from `Chronos.track`.
176167

177168
```js
178169
const chronosConfig = require('./chronos-config.js');
@@ -208,7 +199,6 @@ If you're using `docker-compose` to start up multiple containers, you can add a
208199
volumes:
209200
- "/var/run/docker.sock:/var/run/docker.sock"
210201
```
211-
<br>
212202

213203
### Chronos Tracker for "Kubernetes" Mode
214204
Chronos can monitor an Kubernetes clusters by saving metric data from instant queries to a Prometheus server in your Kubernetes cluster.
@@ -238,7 +228,6 @@ const Chronos = require('@chronosmicro/tracker');
238228
const chronos = new Chronos(chronosConfig);
239229

240230
chronos.kubernetes();
241-
242231
```
243232

244233

@@ -261,7 +250,7 @@ module.exports = {
261250
}
262251
```
263252

264-
Then, in ***ONE AND ONLY ONE** of your microservices, call `Chronos.kafka`:
253+
Then, in **ONE AND ONLY ONE** of your microservices, call `Chronos.kafka`:
265254
```js
266255
const chronosConfig = require('./chronos-config.js');
267256
const Chronos = require('@chronosmicro/tracker');
@@ -397,14 +386,10 @@ chronos.link(client, ServerWrapper);
397386
### Viewing Chronos Data
398387
Once you have configured and intialized Chronos Tracker, it will automatically record monitoring data when your servers are running. The data will be saved into your database of choice, and then start the Chronos desktop app to view by cloning our [GitHub repo](https://github.com/open-source-labs/Chronos). Folow the ReadMe in that repo to setup the Chronos desktop app.
399388

400-
<br>
401389

402390
## Examples
403391

404-
We provide working example microservice applications in Chronos desktop app repo in the *examples* folder.
405-
[GitHub repo](https://github.com/open-source-labs/Chronos)
406-
407-
#
392+
We provide working example microservice applications in Chronos desktop app repo in the [**examples**](../chronos_npm_package/README.md) folder.
408393

409394
## Technologies
410395
- Electron
@@ -421,18 +406,16 @@ We provide working example microservice applications in Chronos desktop app repo
421406
- Docker
422407
- Kubernetes
423408

424-
#
425409

426410
## Contributing
427411

428-
Development of Chronos is open source on GitHub through the tech accelerator umbrella OS Labs, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving Chronos.
412+
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
429413

430-
[Contributing](https://github.com/oslabs-beta/Chronos/blob/master/CONTRIBUTING.md)
414+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
431415

432-
#
433416

434417
## License
435418

436-
Chronos is MIT licenced
419+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
437420
#
438421
###### Return to [Top](#chronos)

examples/AWS/AWS-EC2/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ git archive -v -o myMM.zip --format=zip HEAD
124124
2. Select `cloud-based`
125125

126126
3. Use Access Key, Secret Access Key, region, and EC2 instance ID to start monitoring EC2 instance.
127-
128127
## Contributing
128+
129129
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
130130

131+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
132+
131133

examples/AWS/AWS-ECS/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Step 7: Deploy test application in ECS
6969
### Some notes about the ECS-test
7070

7171
The way deployment set up is using Fargate, you will not be able to see graphs in ECS cluster->metrics. Instead, check inside services or Cloudwatch.
72-
7372
## Contributing
73+
7474
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
75+
76+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.

examples/docker/README.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# Chronos Dockerized Microservices Example
22

33
This sample microservices architecture allows developers to explore the functionality of Chronos but with one docker compose command. This consists of four microservices, which are contained within the directories:
4-
- Reverse Proxy / Frontend
5-
- Books
6-
- Customers
7-
- Orders
4+
- books
5+
- customers
6+
- frontend
7+
- orders
88

9-
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.
10-
The frontend has a reverse proxy set up for proxying requests to the appropriate service in the microservice network. Bear in mind that the use of the word 'services' refers to the individual applications in the microservice network. In development they're all run separately on different ports, with said ports listening out for requests. This is for demonstration and testing purposes. Ideally, in a production environment, all the services will be up and running concurrently from the get go and that's what the docker compose file helps us achieve. It is able to chain all the services and run them together with one command. Docker also ensures that the versions that worked well on dev are bundled up and distributed and used to run the containers for the individual containers.
9+
Each microservice has its own server, which receives requests from both the client and from other microservices.
10+
- _books_, _customers_, and _orders_ also have their own databases, which they can query to respond to those requests.
11+
12+
The frontend has a reverse proxy set up for proxying requests to the appropriate service (individual application) in the microservice network.
13+
14+
In development they're all run separately on different ports, with said ports listening out for requests. This is for demonstration and testing purposes.
15+
16+
Ideally, in a production environment, all the services will be up and running concurrently from the get go and that's what the `docker-compose.yml` file helps us achieve. It is able to chain all the services and run them together with one command.
17+
18+
Docker also ensures that the versions that worked well on dev are bundled up and distributed and used to run the containers for the individual containers.
19+
20+
## Additional Documentation
21+
22+
For additional details on how Chronos works this example, please review the Docker section in the [Chronos NPM Package README](../../chronos_npm_package/README.md).
1123

1224
## Steps to Run Example
1325
Peform the following steps in each of the _books_, _customers_, _frontend_, and _orders_ directories
@@ -17,34 +29,58 @@ Peform the following steps in each of the _books_, _customers_, _frontend_, and
1729

1830
```
1931
CHRONOS_DB = MongoDB or PostgreSQL
20-
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via **Chronos**
21-
BOOK_URI = A **MongoDB** URI for the bookserver microservice to use
22-
CUSTOMER_URI = A **MongoDB** URI for the customerserver microservice to use
23-
ORDER_URI = A **MongoDB** URI for the orderserver microservice to use
32+
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via Chronos
33+
BOOK_URI = A MongoDB URI for the bookserver microservice to use
34+
CUSTOMER_URI = A MongoDB URI for the customerserver microservice to use
35+
ORDER_URI = A MongoDB URI for the orderserver microservice to use
2436
```
25-
2. Verify that @chronosmicro/tracker is a dependency in each of the /books, /customers, /frontend, and /orders folders (see the `package.json` in each folder).
37+
2. Verify that `@chronosmicro/tracker` is a dependency in each of the _books_, _customers_, _frontend_, and _orders_ folders (see the `package.json` in each folder).
2638

27-
- If the @chronosmicro/tracker dependency is listed as a remote npm package (i.e. `"@chronosmicro/tracker": "^8.0.3"`) and you've ran *npm install*, no further work is needed continue to step 3. If you have the dependency as `"@chronosmicro/tracker": "file:./chronos_npm_package"`, make sure to change the version from `"file:./chronos_npm_package"` to `"^8.0.3"` and run npm install.
39+
- If the @chronosmicro/tracker dependency is listed as a **remote** npm package (i.e. `"@chronosmicro/tracker": "^11.0.1"`) and you've ran `npm install`, no further work is needed continue to step 3.
2840

29-
3. With the terminal navigated to the the examples/docker folder, run the command:
41+
- If you have the dependency as
42+
`"@chronosmicro/tracker": "file:./chronos_npm_package"`, which is a **local** file, make sure to change the version from `"file:./chronos_npm_package"` to `"^11.0.1"` and run npm install.
43+
44+
3. With the terminal navigated to the the _examples/docker_ folder, run the command:
3045
```
3146
docker-compose -f docker-compose.yml up
3247
```
3348

3449
#
3550

36-
You should now see the containers running in your terminal, each reporting "Docker data recorded in...". If this is being displayed for the books, customers, frontend, and orders microservices then the example is successfully saving health metrics to your database of choice!
51+
You should now see the containers running in your terminal, each reporting `"Docker data recorded in..."`.
52+
53+
<p align="center">
54+
<img alt="docker data being recorded" src="../../assets/examples_docker_data.png">
55+
</p>
3756

38-
*If there is any error when running the applications and the underlying files for a microservice were changed, be sure to delete the previous image before calling `docker-compose -f docker-compose.yml up` again. If you do not, the docker compose command will not know to rebuild the image and the code changes meant to fix any issues will not be rolled into the existing Docker image!*
57+
If this is being displayed for the books, customers, frontend, and orders microservices then the example is successfully saving health metrics to your database of choice!
58+
59+
If there is any error when running the applications and the underlying files for a microservice were changed, be sure to delete the previous image before calling `docker-compose -f docker-compose.yml up` again.
60+
61+
- If you do not, the above docker compose command will not know to rebuild the image and the code changes meant to fix any issues will not be rolled into the existing Docker image!
3962

4063
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
4164

65+
## To stop and remove containers
66+
67+
To stop containers, use `^C`.
68+
69+
<p align="center">
70+
<img alt="docker containers stopped" src="../../assets/examples_docker_stop.png">
71+
</p>
4272

43-
# To stop and remove containers
44-
Use `docker compose down` to stop containers
73+
Use `docker compose down` to remove.
4574

75+
<p align="center">
76+
<img alt="docker containers removed" src="../../assets/examples_docker_removed.png">
77+
</p>
4678

4779
## Contributing
80+
4881
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
82+
83+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
4984
## License
50-
[MIT](LICENSE)
85+
86+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)

examples/gRPC/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This sample microservices architecture allows developers to explore the function
99

1010
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.
1111

12+
13+
## Additional Documentation
14+
15+
For additional information on how Chronos works this example, please review the gRPC section in the [Chronos NPM Package README](../../chronos_npm_package/README.md).
16+
1217
## Getting Started w/ gRPC Example Microservices
1318

1419
Follow **'main'** branch [README](../../README.md) steps: Pre-Installation, Install Dependencies before start.
@@ -56,9 +61,11 @@ Inside the downloaded directory, install all dependencies using the `npm install
5661

5762
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
5863

64+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
65+
5966
## License
6067

61-
[MIT](LICENSE)
68+
[MIT](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
6269

6370
[npm-image]: https://img.shields.io/npm/v/chronos-microservice-debugger3.svg
6471
[npm-url]: https://www.npmjs.com/package/chronos-microservice-debugger3

0 commit comments

Comments
 (0)