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: examples/microservices/README.md
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,36 @@ Microservices architecture for testing [Chronos](https://github.com/open-source-
4
4
5
5
## Purpose and Design
6
6
This sample microservices architecture allows developers to explore the functionality of Chronos. It consists of four microservices, which are contained within the directories:
7
-
-Reverse Proxy
8
-
-Books
9
-
-Customers
10
-
-Orders
7
+
-books
8
+
-customers
9
+
-orders
10
+
-reverse_proxy
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
-
## Steps to Run Example
15
-
1.Create a single .env file in the *examples/microservices* folder with the following key/value pairs:
14
+
## To Set Up Database for Storing/Retrieving Metrics
15
+
Create a single .env file in the *examples/microservices* folder with the following key/value pairs:
16
16
-`CHRONOS_DB`: `MongoDB` or `PostgreSQL`
17
-
-`CHRONOS_URI`: The URI to the desired MongoDB or PostgreSQL database to save health metrics via **Chronos**
18
-
-`BOOK_URI`: A **MongoDB** URI for the bookserver microservice to use
19
-
-`CUSTOMER_URI`: A **MongoDB** URI for the customerserver microservice to use
20
-
-`ORDER_URI`: A **MongoDB** URI for the orderserver microservice to use
17
+
-`CHRONOS_URI`: The URI to the desired MongoDB or PostgreSQL database to save health metrics via **Chronos NPM Package**
18
+
-`BOOK_URI`: A **MongoDB** URI for the `books` microservice to use
19
+
-`CUSTOMER_URI`: A **MongoDB** URI for the `customers` microservice to use
20
+
-`ORDER_URI`: A **MongoDB** URI for the `orders` microservice to use
21
21
22
+
Note: The `CHRONOS_URI` and all microservice `_URI`'s can be the same URI if you use MongoDB. You may run out of space in your database if the services run for an extended period of time. You can temporarily solve this by creating separate databases, or manually deleting the collection from the database regularly using a UI such as MongoDB Compass. When running, the microservices will create new collections if none are found in the database.
22
23
23
-
Peform the following steps in each of the *books*, *customers*, *orders*, and *reverse proxy* directories
24
+
## Start the Microservices
25
+
Peform the following steps in each of the *books*, *customers*, *orders*, and *reverse_proxy* directories
24
26
1.`cd` into the folder
25
27
2. Look at `package.json` to note where `@chronosmicro/tracker` is being imported from. Verify that it is coming from the desired location (whether the published remote from npm or from local directory).
26
28
3. Run `npm install`
27
29
4. Run `npm run start`
28
30
31
+
**Mac Users:** Alternative to the above list of steps, `cd` into the `scripts` folder and run the `startMicroservices.sh` script
32
+
29
33
#
30
-
Then open a web browser to `localhost:3000` and verify that the simple webpage application is operational.
34
+
Then open a web browser to `localhost:3000` and verify that the simple webpage application is operational. You can use the web app if you wish, but it is not necessary for retrieving and visualizing health metrics in Chronos.
31
35
32
-
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
36
+
Your microservice health metrics can now be viewed in the given `CHRONOS_URI` database, or, preferrably, in the Electron.js desktop application.
0 commit comments