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/docker/README.md
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,30 +23,38 @@ Docker also ensures that the versions that worked well on dev are bundled up and
23
23
24
24
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).
25
25
26
-
## Steps to Run Example
27
26
27
+
28
+
## Grafana API KEY
29
+
30
+
1. Run docker compose command below (LN 64) to start your Grafana container before you can access your service account token.
31
+
32
+
2. In your browser, go to `localhost:32000`, which will be the login page of grafana. Use `admin` as both username and password to login. You can change the password after login.
33
+
34
+
3. Navigate to `Home -> Administration -> Service accounts`, then click `Add service account` to create an service account. Be sure to choose `Admin` as the role. Then click `Add service account token`, hit `generate`, you are done! Remember this token, you will be using this token to access Grafana HTTP API programmatically.
35
+
36
+
## Steps to Run Example
28
37
Peform the following steps in each of the _books_, _customers_, _frontend_, and _orders_ directories
29
38
30
-
1. Add a `.env` file to _each_ folder with the following key/value pairs:
39
+
1. Add a `.env` file to each of _books_, _customers_, _frontend_, and _orders_ folders with the following key/value pairs:
31
40
32
41
-**NOTE**: Ensure that there are no quotes surrounding any of the keys and values.
33
42
34
-
> > > New collaboration group - testing all 5 url added to each .env// --> testing now...<<<
35
-
36
43
```
37
44
CHRONOS_DB = MongoDB or PostgreSQL
38
45
CHRONOS_URI = The URI to the desired MongoDB or PostgreSQL database to save health metrics via Chronos
39
46
BOOK_URI = A MongoDB URI for the bookserver microservice to use
40
47
CUSTOMER_URI = A MongoDB URI for the customerserver microservice to use
41
48
ORDER_URI = A MongoDB URI for the orderserver microservice to use
49
+
CHRONOS_GRAFANA_API_KEY = Bearer [the access token you created in above section (Grafana API Key)]
42
50
```
43
51
44
52
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).
45
53
46
-
- 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.
54
+
- If the @chronosmicro/tracker dependency is listed as a **remote** npm package (i.e. `"@chronosmicro/tracker": "^12.0.1"`) and you've ran `npm install`, no further work is needed continue to step 3.**However, confirm that the "@chronosmicro/tracker" you've installed from npm has the correct database names you will query later because the database automation will build from the npm installed version
47
55
48
56
- If you have the dependency as
49
-
`"@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.
57
+
`"@chronosmicro/tracker": "file:./chronos_npm_package"`, which is a **local** file, make sure to change the version from `"file:./chronos_npm_package"` to `"^12.0.1"` and run npm install.
50
58
51
59
3. With the terminal navigated to the the _examples/docker_ folder, run the command:
52
60
@@ -56,9 +64,10 @@ ORDER_URI = A MongoDB URI for the orderserver microservice to use
56
64
docker-compose -f docker-compose.yml up
57
65
```
58
66
59
-
4. If you run into any issues regarding 'linux/amd64,linux/arm/v7,linux/arm64/v8' for cadvisor, navigate to the docker-compose.yml and find the cadvisor dictionary. Change "platform" to linux/arm64/v8 for M1 Chips and linux/amd64 for Intel Chips.
60
-
61
-
If you run into any issues regarding versions/images cadvisor, navigate to the docker-compose.yml and find the cadvisor dictionary. Change "image" to `image: gcr.io/cadvisor/cadvisor:latest` to `image: gcr.io/cadvisor/cadvisor:v0.47.0`
67
+
4. If you run into any issues regarding `linux/amd64,linux/arm/v7,linux/arm64/v8` for cadvisor, navigate to the docker-compose.yml and find the cadvisor dictionary and try the below solutions.
68
+
1. Change `platform` to `linux/arm64/v8` for M1 Chips and `linux/amd64` for Intel Chips.
69
+
2. Change "image" to `image: gcr.io/cadvisor/cadvisor:latest` to `image: gcr.io/cadvisor/cadvisor:v0.47.0`
70
+
3. Alternatively, use Docker Buildx to specify multi-platform.
(The second image is inside k8s_node-backend_node-backend-d597768c-6zm5j_default_46da04f8-99c6-4522-9141-6c05f8d5141d_0, it may take a while to show up in Docker desktop based on the scraping interval)
89
92
90
93
91
94
Your microservice health metrics can now be viewed at the given `CHRONOS_URI` or, preferrably, in the Electron.js desktop application.
**Mac Users:** Alternative to running the above commands, `cd` into the *scripts* folder and run the `stopKuber.sh` script
105
108
106
-
**Note**: The above part only teardown Prometheus and Kubernetes, it leaves Grafana running. This is because if you teardown Grafana, the next time you redeploy you will be login with a new account, the access token and dashboard you created within this account will lose.
109
+
**Note**: The above part only teardown Prometheus and Kubernetes, it leaves Grafana running. This is because if you teardown Grafana, the next time you redeploy you will be login with a new account, the access token and dashboard you created within this account will be lost.
0 commit comments