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
Additional documentation on how Chronos is used **in each example** can be found in the [Chronos NPM Package README](./chronos_npm_package/README.md).
134
135
135
136
#### _AWS_
136
137
@@ -175,9 +176,15 @@ In the `microservices` folder, we provide a sample microservice application that
175
176
Refer to the [microservices README](./examples/microservices/README.md) in the `microservices` folder for more details.
176
177
#
177
178
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
+
#
178
183
## Contributing
179
184
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.
181
188
182
189
### **Last Iterating Team**
183
190
@@ -216,8 +223,7 @@ Development of Chronos is open source on GitHub through the tech accelerator umb
216
223
217
224
## License
218
225
219
-
Chronos is [MIT licensed.](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)
Copy file name to clipboardExpand all lines: chronos_npm_package/README.md
+10-27Lines changed: 10 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
-
8
1
## What's New?
9
2
- Bug Fixes
10
3
- Refactored code for additional modularity and customization
11
4
- Ability for developers to increase number of metrics monitored for microservices
12
-
13
5
#
14
6
15
7
## Features
@@ -32,7 +24,6 @@ Install the package as a dependency in each of the microservices you want to tra
32
24
npm install @chronosmicro/tracker
33
25
```
34
26
35
-
<br>
36
27
37
28
### Configuring Chronos Tracker
38
29
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.
_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
141
131
-`user` - The email address (string) of the sender
142
132
-`password` - The password (string) of the sender email
143
133
144
-
_NOTE: Email notification settings may require alternative security settings to work_
145
134
146
-
<br>
135
+
**NOTE: Email notification settings may require alternative security settings to work**
147
136
148
137
### Chronos Tracker for "Microservices" Mode
149
138
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_.
150
139
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.
152
141
153
142
```js
154
143
// Excerpt from a chronos-config.js
@@ -172,7 +161,9 @@ const chronos = new Chronos(chronosConfig);
172
161
chronos.track()
173
162
```
174
163
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`.
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.
399
388
400
-
<br>
401
389
402
390
## Examples
403
391
404
-
We provide working example microservice applications in Chronos desktop app repo in the *examples* folder.
We provide working example microservice applications in Chronos desktop app repo in the [**examples**](../chronos_npm_package/README.md) folder.
408
393
409
394
## Technologies
410
395
- Electron
@@ -421,18 +406,16 @@ We provide working example microservice applications in Chronos desktop app repo
421
406
- Docker
422
407
- Kubernetes
423
408
424
-
#
425
409
426
410
## Contributing
427
411
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.
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
8
8
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).
11
23
12
24
## Steps to Run Example
13
25
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
17
29
18
30
```
19
31
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
24
36
```
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).
26
38
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.
28
40
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:
30
45
```
31
46
docker-compose -f docker-compose.yml up
32
47
```
33
48
34
49
#
35
50
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
+
<palign="center">
54
+
<imgalt="docker data being recorded"src="../../assets/examples_docker_data.png">
55
+
</p>
37
56
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!
39
62
40
63
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
Copy file name to clipboardExpand all lines: examples/gRPC/README.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,11 @@ This sample microservices architecture allows developers to explore the function
9
9
10
10
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.
11
11
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
+
12
17
## Getting Started w/ gRPC Example Microservices
13
18
14
19
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
56
61
57
62
Chronos hopes to inspire an active community of both users and developers. For questions, comments, or contributions, please submit a pull request.
58
63
64
+
Read our [contributing README](../../CONTRIBUTING.md) to further learn how you can take part in improving Chronos.
0 commit comments