Skip to content

Commit ad9fea3

Browse files
weiwang0305AliciaZ429peterchunggabyspg
committed
got the saveMetrics routes to work
Co-authored-by: Alicia <[email protected]> Co-authored-by: peterchung <[email protected]> Co-authored-by: Gabriela Pleitez Gomez <[email protected]>
1 parent 548f006 commit ad9fea3

File tree

14 files changed

+57
-45
lines changed

14 files changed

+57
-45
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Make sure to update versions to whatever the latest is
22
EXTENSION_IMAGE?=docketeerxiv/docketeer-extension
3-
VERSION?=15.0.0
3+
VERSION?=16.0.0
44
DEV_EXTENSION_NAME=docketeer-extension-dev
55
DOCKERFILEDIRECTORY=extension
66
BUILDER=buildx-multi-arch

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<a href="#about-the-project">About Docketeer</a></li>
6262
<li><a href="#installation">Installation</a></li>
6363
<li><a href="#in-development">In Development</a></li>
64+
<li><a href="#documentation">Documentation</a></li>
6465
<li><a href="#contributing">Contributing</a></li>
6566
<li><a href="#license">License</a></li>
6667
<li><a href="#authors">Authors</a></li>
@@ -82,7 +83,8 @@
8283
<img alt="Containers Page" src="assets\docketeer-containers-page.png" width="fit" height="auto">
8384
<img alt="Network Page" src="assets\docketeer-network-page.png" width="fit" height="auto">
8485
<img alt="Container Metrics Page" src="assets\docketeer-metrics-page.png" width="fit" height="auto">
85-
<img alt="Kubernates Metrics Page" src="assets\docketeer-kubernetes-metrics-page.png" width="fit" height="auto">
86+
<img alt="Kubernates Metrics Page" src="assets\docketeer-kubernetes-metrics-page.png" width="fit" height="auto">
87+
<img alt="Snapshot Page" src="assets\docketeer-snapshots-page.png" width="fit" height="auto">
8688
</div>
8789
<br />
8890

@@ -125,6 +127,24 @@ See the [Known Issues Docs](/docs/dev/KnownIssues.md) and [open issues](https://
125127

126128
<p align="right">(<a href="#readme-top">back to top</a>)</p>
127129

130+
<!-- IN DEVELOPMENT -->
131+
132+
## Documentation
133+
For more details, please read the ***docs*** folder, which covers the following:
134+
135+
- API
136+
- Assets
137+
- Changelogs (V1-V15)
138+
- Features
139+
- Configuration.md
140+
- Models.md
141+
- DevGettingStarted.md
142+
- DevWorkingWithGrafana.md
143+
- Docketeer16.note.md ***(MOST RECENT CHANGES)***
144+
- KnownIssues.md
145+
146+
When you are ready to launch, make sure to follow the instructions under ***Makefile***.
147+
128148
<!-- CONTRIBUTING -->
129149

130150
## Contributing
@@ -241,7 +261,10 @@ Please ⭐️ this project if you found it helpful, thank you!
241261
- Jonathan Gray [@thejohnny5](https://github.com/thejohnny5) | [LinkedIn](https://www.linkedin.com/in/jonathan-gray-987169183/)
242262
- Cristian Morales [@Cris-Morales](https://github.com/Cris-Morales) | [LinkedIn](https://www.linkedin.com/in/cmorales-uxr274/)
243263
- Josh Nelson [@JoshNelson98](https://github.com/JoshNelson98) | [LinkedIn](https://www.linkedin.com/in/josh-nelson-7aba19284/)
244-
- Christian Lyon [@christianDoesCoding](https://github.com/christianDoesCoding) | [LinkedIn](www.linkedin.com/in/christiandoescoding)
264+
- Alicia Zhang [@AliciaZ429](https://github.com/AliciaZ429) | [LinkedIn](https://www.linkedin.com/in/alicia-zhang-a1aaa2138/ )
265+
- Wei Cheng Wang [@weiwang0305](https://github.com/weiwang0305) | [LinkedIn](https://www.linkedin.com/in/wei-cheng-wang-2a92b4120/)
266+
- Gabriela Pleitez Gomez [@gabyspg](https://github.com/gabyspg) | [LinkedIn](https://www.linkedin.com/in/gabriela-pleitez-gomez)
267+
- Peter Chung [@peterchung](https://github.com/peterchung) | [LinkedIn](https://www.linkedin.com/in/peterminkichung/)
245268

246269

247270
<p align="right">(<a href="#readme-top">back to top</a>)</p>

assets/docketeer-metrics-page.png

-42.6 KB
Loading
161 KB
Loading
File renamed without changes.
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
* ***datasources*** tells Grafana where to look for metrics. You'll see that it is already set up to query the Prometheus instance on port 9000 (see the Docketeer Config Diagram in ***/docs/assets/docketeer-config.png***). Do not change this file.
1212

13-
* ***dashboards*** contains our JSON and yaml files that build our dahboards. These are the primary files to edit if you want to change the dashboards or create a new one. The yaml file tells Grafana where to fetch the files to build our dashboards, and what datasource we are using for our panels and queries. Each JSON file will build a seperate dashboard for use to use as an embedded iframe in Docketeer. Currently there are 3: ***dashboard.json*** which is used in the Containers tab, ***docker_metrics.json*** which is used in the Container Metrics tab, and ***k8s-views-nodes.json*** which is used in the Kubernetes Metrics tab. Each JSON file is thousands of lines long, and has many configurations to achieve the graphs we have. To edit, or add panels, the primary method is to navigate to the Grafana and Prometheus endpoints, and to use the Grafana GUI.
13+
* ***dashboards*** contains our JSON and yaml files that build our dahboards. These are the primary files to edit if you want to change the dashboards or create a new one. The yaml file tells Grafana where to fetch the files to build our dashboards, and what datasource we are using for our panels and queries. Each JSON file will build a seperate dashboard for use to use as an embedded iframe in Docketeer. Currently there are 4: ***dashboard.json*** which is used in the Containers tab, ***docker_metrics.json*** which is used in the Container Metrics tab, ***snapshot-dashboard.json*** which is used in the Snapshot tab, and ***k8s-views-nodes.json*** which is used in the Kubernetes Metrics tab. Each JSON file is thousands of lines long, and has many configurations to achieve the graphs we have. To edit, or add panels, the primary method is to navigate to the Grafana and Prometheus endpoints, and to use the Grafana GUI.
1414

1515
## Using the Grafana GUI
1616

@@ -30,22 +30,24 @@ When running Docketeer in Dev Mode, a Grafana instance is running on the exposed
3030

3131
* To change a panel click on the 3 dots in on the upper right of the metric you want to change. Select "Edit".
3232

33-
* Now we can change our query, visualization, and configurations using the Grafana GUI instead of coding the JSON by hand. When you're done, click apply then save, before navigating back to our dashboard.
33+
* Now we can change our query, visualization, and configurations using the Grafana GUI instead of coding the JSON by hand. When you're done, click apply then save, before navigating back to our dashboard.
3434

3535
* You will notice that once you save, the changes will be reflected in Docketeer. However, These changes will not persist if you rebuild Docketeer. To persist these changes on rebuild we will have to edit the JSON of our dashboards.
3636

3737
* If you made an individual change on a panel. Click the 3 dots on the changed panel, and select "Inspect". Here you can see your Data, Stats, JSON, and Query, but we are interested in the JSON. Copy this entire JSON, and use this to replace the panel in the original dashboard JSON. The easiest way to find the panel you're looking for is to search for the panel name, and to replace the object containing it with your new JSON.
3838

3939
* Tear down Docketeer, and rebuild to see if the panel has been replaced with your updated one. Sometimes, after tear down, you will need to delete all your images, and delete all volumes except for the prometheus data volume before rebuilding Docketeer in order to make docker rebuild the Grafana instance.
4040

41-
* If you made many changes to many panels, or to the shared settings like timeframe and refresh rate, the JSON process will be slightly different. Click the share button on the Nav Bar, here you can export the entire dashboard ysing different methods. Select "Export" then "View JSON". This is the JSON for the entrie dashboard you have been working on. Select all and copy the JSON. Replacing the whole dashboard JSON will result in an error, so instead you will need to replace the "panels" array. Paste your copied JSON into a seperate VSC window, and callapse the "panels" array to make it easier to copy (in some cases it is thousands of lines long). Callapsed the "panels" array in your dashboard JSON and replace it with your new and improved panels array. Rebuild and your dashboard should be updated with the changes you made.
41+
* If you made many changes to many panels, or to the shared settings like timeframe and refresh rate, the JSON process will be slightly different. Click the share button on the Nav Bar, here you can export the entire dashboard ysing different methods. Select "Export" then "View JSON". This is the JSON for the entrie dashboard you have been working on. Select all and copy the JSON. Replacing the whole dashboard JSON will result in an error, so instead you will need to replace the "panels" array. Paste your copied JSON into a seperate VSC window, and callapse the "panels" array to make it easier to copy (in some cases it is thousands of lines long). Callapsed the "panels" array in your dashboard JSON and replace it with your new and improved panels array. Rebuild and your dashboard should be updated with the changes you made.
4242

4343
## Aditional Notes
4444

45-
* Review the [Grafana Docs](https://grafana.com/docs/grafana/latest/) for details on the configuration files, and working with the JSON settings.
45+
* Review the [Grafana Docs](https://grafana.com/docs/grafana/latest/) for details on the configuration files, and working with the JSON settings.
4646

4747
* To see what your Prometheus query is returning, go to the Prometheus endpoint, exposed in the development mode on port 49156. On localhost:49156 you can insert queries and get raw data to confirm any errors you get on the Grafana Visualizer.
4848

4949
* Review the [Prometheus Docs](https://prometheus.io/docs/introduction/overview/) for details on PromQL and Prometheus.
5050

51-
* . Prometheus is scrapping the container data from cAdvisor which is running on port 49158 in development mode. You can visit this in browser to compare any metrics you're fetching in Prometheus or Grafana. See more in the [Prometheus Docs](https://prometheus.io/docs/guides/cadvisor/) and the [cAdvisor Github](https://github.com/google/cadvisor).
51+
* . Prometheus is scrapping the container data from cAdvisor which is running on port 49158 in development mode. You can visit this in browser to compare any metrics you're fetching in Prometheus or Grafana. See more in the [Prometheus Docs](https://prometheus.io/docs/guides/cadvisor/) and the [cAdvisor Github](https://github.com/google/cadvisor).
52+
53+
* When export dashboards, Grafana tends to create varibles such as {DS_Prometheus} or {DS_Postgres}. If you run into issues regarding this, find the specific uid for by clicking the 3 dots of a specific panel and looking at its JSON.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* ***Important***: DO NOT USE CORS IN THE BACKEND! It will mess up the ddClientRequests.
2+
13
* Not all of the backend endpoints are being used currently as they were not built out on the frontend
24
* The Configuration Tab currently only reads and writes to the database, need both update and delete
3-
* The purpose of the Configuration Tab is to configure Prometheus endpoints that the app can scrape. This needs to be set up on the backend. When an endpoint is added to the configuration database, a .yml file needs to be generated for the new endpoint (see the imageConfigs/prometheus/prometheus.yml on how this file looks). The prometheus container then must be reloaded pointing to the new configuration file. This should allow prometheus to scrape from this new config file.
5+
* The purpose of the Configuration Tab is to configure Prometheus endpoints that the app can scrape. This needs to be set up on the backend. When an endpoint is added to the configuration database, a .yml file needs to be generated for the new endpoint (see the imageConfigs/prometheus/prometheus.yml on how this file looks). The prometheus container then must be reloaded pointing to the new configuration file. This should allow prometheus to scrape from this new config file.
File renamed without changes.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
* Changed ***Metrics*** tab dashboard (see imageConfigs/grafana/provisioning/docker_metrics.json)
77
* Added ***Kubernetes Metrics*** tab for monitoring nodes running on a kubernetes cluster (see imageConfigs/grafana/provisioning/k8s-view-nodes.json)
88
* Added ability to search through container logs based on timeframe, as well as keywords and select-all functionality
9-
* Added a Home button to the Container and K8 Metrics Tabs so users can return to the dashboard after viewing indivi
10-
ual panels
9+
* Added a Home button to the Container and K8 Metrics Tabs so users can return to the dashboard after viewing individual panels
1110

1211
#### Dev Features
1312
* Fixed backend API and added documentation (docs/api/openapi.yml)

docs/docketeer16.notes.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
## v16.0.0
4+
#### Features
5+
* Added ***Save Metric*** button under Container Metrics tab to save 6 key metrics of the container. Key metrics are metric date, diskspace, memory, swap, cpu usage and available memory. Those metrics are saved in PostgreSQL.
6+
* Added ***Snapshot*** page. By selecting a timestamp in the dropdown, users can compare the metrics saved in the database.
7+
* Added ***Snapshot test*** dashboard in Grafana for display the metrics visualization. (see /imageConfigs/grafana/provisioning/dashboards/snapshot-dashboard.json)
8+
* Added ***configurations*** to connect Grafana dashboard and PostgreSQL (see /imageConfigs/grafana/provisioning/datasources/srcPostgres.yml)
9+
10+
11+
#### Dev Features
12+
13+
#### Bug Fixes
14+
* Fixed all frontend ***testing*** files to make sure the components are being rendered. Testings include Container tab, Image tab, Metric tab, Network tab, Volume tab and Reducers.
15+
* Fixed all server ***testing*** files to make sure all the routes are functioning as expected. Testing include Network Routes
16+
17+
#### Misc. Fixes and Cleaning
18+
* Added ***Typescript*** to new features and fixed some Typescript on previous codebase.
19+
* Added additional information to ***Documentation*** to help with later iterations.

0 commit comments

Comments
 (0)