Skip to content

Commit e3987b7

Browse files
committed
merged branch
2 parents 6dcc198 + 49f1a07 commit e3987b7

File tree

157 files changed

+193
-23093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+193
-23093
lines changed

.github/workflows/integrate.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Frontend and Backend testing
2+
3+
on:
4+
pull_request:
5+
branches: [devDocker_v2]
6+
7+
jobs:
8+
frontend_testing:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 18
15+
- run: npm install --package-lock-only
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm run test
19+
20+
backend_testing:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 7
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-node@v1
26+
with:
27+
node-version: 18
28+
- run: npm install --package-lock-only
29+
- run: npm ci
30+
- run: npm run build
31+
- run: npx jest --config __backend-tests__/jest.config.js --verbose

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
# Setup .npmrc file to publish to npm
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: '18.17.1'
14+
registry-url: 'https://registry.npmjs.org'
15+
- run: npm ci
16+
- run: npm publish ./chronos_npm_package --access=public
17+
env:
18+
# need to add NPM token to github secret if not available
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"endOfLine": "auto",
55
"arrowParens": "avoid",
66
"printWidth": 100
7-
}
7+
}

README.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<a href="https://chronoslany.com/">
22
<img src="assets/animated_logo.gif" alt="Chronos" title="Chronos" align="center" height="500" />
33
</a>
4+
<hr>
5+
<a href="https://chronoslany.com/">
6+
<img src="assets/demo.gif" alt="Chronos" title="Chronos" align="center" height="500" width="auto" />
7+
</a>
48

59
<br>
610

@@ -16,27 +20,31 @@
1620
### ⭐️ Star us on GitHub! ⭐️
1721
**Visit our website at [chronoslany.com](https://chronoslany.com/).**
1822

19-
Chronos is a comprehensive developer tool that monitors the health and web traffic of servers, microservices, containers, and Amazon Web Services (AWS). Use Chronos to see real-time data monitoring and receive automated notifications over Slack or email.
23+
Chronos is a comprehensive developer tool that monitors the health and web traffic for containerized (Docker & Kubernetes) and non-containerized microservices communicated via REST APIs or gRPC, whether hosted locally or on Amazon Web Services (AWS). Use Chronos to see real-time data monitoring and receive automated notifications over Slack or email.
2024

2125

2226
## What's New?
2327

24-
### With Chronos 11.0:
28+
### With Chronos 12.0:
29+
30+
- Enhanced metrics visualization by integrating more interactive and adaptable Grafana charts, particularly for Docker and Kubernetes use cases.
31+
- Achieved an 80% boost in test coverage by formulating comprehensive unit, integration, and end-to-end tests employing Jest and Selenium.
32+
- Rectified issues with the Docker example, ensuring accurate metric display.
33+
- Devised an immersive 3D visualization that effectively illustrates the Kubernetes cluster infrastructure, encompassing Namespace, Service, and Pod entities. This dynamic visualization provides developers and users with heightened insights into intricate resource allocation and configuration within the cluster.
34+
- Streamlined operational effectiveness by coordinating CI/CD pipelines, automating testing workflows, and establishing deployment protocols, ultimately leading to accelerated development cycles and heightened dependability.
35+
- Expanded Typescript coverage to enhance code quality and bolster application resilience.
36+
- Updated the Docker and Kubernetes example READMEs with detailed instructions on configuring Prometheus and Grafana seamlessly.
37+
- Enhanced clarity of instructions in the `@chronosmicro/tracker` NPM package's README, offering comprehensive guidance on utilizing the package to monitor individual applications effectively.
2538

39+
40+
**Previously implemented updates:**
2641
- Added interactive charting to better visualize metrics and increase user engagement with their data
2742
- Followed best test-driven development practices and increased testing with React Testing and Jest for the front end
2843
- Overhauled user database security, mitigating database breaches and providing a safer experience
2944
- Bug fixes and UI tweaks, creating a more pleasant user experience
3045
- Updated outdated README instructions within the provided Docker, gRPC, Kubernetes, and microservices examples
3146
- Revised README instructions for the `@chronosmicro/tracker` NPM package
3247

33-
34-
**Previously implemented updates:**
35-
- Streamlined approach to access and dynamically display Grafana dashboards for deployed EKS clusters (utilizing Prometheus data scraping and generated Grafana dashboards) using the Grafana API.
36-
- Option to choose between cloud hosted services and local services, giving Chronos the ability to monitor instances and clusters on AWS' EC2, ECS, and EKS platforms.
37-
- An updated AWS Graphs Container to dynamically render plots for EC2 or ECS data fetched with Electron using event listeners connecting to AWS CloudWatch w/ the aws-sdk package, as well as utilizing Prometheus data scraping and Grafana integration to fetch and render EKS data.
38-
- Step-by-step instructions on setting up a new, functional EC2 instances, ECS clusters, and EKS clusters, ready to be monitored and tested by the app.
39-
4048
## Features
4149

4250
- Cloud-Based Instances:
@@ -45,15 +53,15 @@ Chronos is a comprehensive developer tool that monitors the health and web traff
4553
- Enables distributed tracing enabled across microservices applications
4654
- Displays real-time temperature, speed, latency, and memory statistics for local services
4755
- Displays and compares multiple microservice metrics in a single graph
48-
- Allow Kubernetes monitoring via Prometheus server
56+
- Allow Kubernetes and Docker monitoring via Prometheus server and Grafana visualization.
4957
- Compatible with <img src="assets/graphql-logo-color.png" alt="GraphQL" title="GraphQL" align="center" height="20" /></a>
5058
- Monitor an <a href="#"><img src="assets/pngwing.com.png" alt="Apache Kafka" title="Apache Kafka" align="center" height="20" /></a> cluster via the JMX Prometheus Exporter
5159
- Supports <a href="#"><img src="assets/postgres-logo-color.png" alt="PostgreSQL" title="PostgreSQL" align="center" height="20" /></a> and <img src="assets/mongo-logo-color.png" alt="MongoDB" title="MongoDB" align="center" height="20" /></a> databases
5260

5361

5462
# Installation
5563

56-
This is for the latest Chronos **version 11.0 release**.
64+
This is for the latest Chronos **version 12.0 release**.
5765

5866
## NPM Package
5967

@@ -68,6 +76,7 @@ For more details on the NPM package and instructions for how to use it, please v
6876
#
6977

7078
<!-- ### Node Version -->
79+
<!-- v12 notes: Our team also had no issues - we ran Node 18 and Electron 22-->
7180
<!-- v11 notes: Our team also had no issues - we ran Node 18.-->
7281
<!-- v10 notes: Our team never reverted to version 16.17.1 and had no issues running Node 18 and Electron 22 together. Commenting this out for future iteration teams' reference. -->
7382
<!-- Make sure you're running version 16.17.1 of <img src="assets/node-logo-color.png" alt="Node" title="Node" align="center" height="20" />, to align with the <img src="assets/node-logo-color.png" alt="Node" title="Node" align="center" height="20" /> version used by <img src="assets/electron-logo-color.png" alt="Electron" title="Electron" align="center" height="20" /> version 22. -->
@@ -106,6 +115,7 @@ export DISPLAY="`sed -n 's/nameserver //p' /etc/resolv.conf`:0"
106115
2. Run `npm run build`
107116
3. Open a new terminal and run `npm run dev:app` to start the Webpack development server
108117
4. Open a new terminal and run `npm run dev:electron` to start the Electron UI in development mode
118+
.
109119
#
110120
### Packing the Chronos desktop app into an executable
111121

@@ -163,7 +173,7 @@ Refer to the [gRPC README](./examples/gRPC/README.md) in the `gRPC` folder for m
163173

164174
#### _Kubernetes_
165175

166-
The `kubernetes` folder includes a React frontend and an Express server backend, and the Dockerfiles needed to containerize them for Kubernetes deployment. The _launch_ folder includes the YAML files needed to configure the deployments, services, and configurations of the frontend, backend, and Prometheus server.
176+
The `kubernetes` folder includes a React frontend and an Express server backend, and the Dockerfiles needed to containerize them for Kubernetes deployment. The _launch_ folder includes the YAML files needed to configure the deployments, services, and configurations of the frontend, backend, Prometheus server, and Grafana.
167177

168178
Refer to the [Kubernetes README](./examples/kubernetes/README.md) in the `kubernetes` folder for more details.
169179

@@ -178,7 +188,7 @@ Refer to the [microservices README](./examples/microservices/README.md) in the `
178188

179189
# Testing
180190

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).
191+
We've created testing suites for Chronos with React Testing, Jest, and Selenium for unit, integration, and end-to-end tests - instructions on running them can be found in the [testing README](./__tests__/README.md).
182192
#
183193
## Contributing
184194

@@ -188,12 +198,11 @@ Read our [contributing README](../../CONTRIBUTING.md) to learn how you can take
188198

189199
### **Last Iterating Team**
190200

191-
#### Chronos 11.0
192-
- [Lucie Seidler](https://github.com/LucieSeidler)
193-
- [Jeffrey Na](https://github.com/jeffreyNa)
194-
- [Brisa Zhu](https://github.com/beezoo10)
195-
- [Kelsi Webb](https://github.com/kelsicw)
196-
- [Justin Poirier](https://github.com/jcpoirier20)
201+
#### Chronos 12.0
202+
- [Tyler Coryell](https://github.com/Tcoryell)
203+
- [Edwin Leong](https://github.com/edwinlny)
204+
- [Eisha Kaushal](https://github.com/eishakaushal)
205+
- [Haoyu Liu](https://github.com/HaoyL666)
197206

198207

199208
#### Past [Contributors](contributors.md)
@@ -219,6 +228,14 @@ Read our [contributing README](../../CONTRIBUTING.md) to learn how you can take
219228
- <a href="#"><img src="assets/vis-logo-color.png" alt="Vis.js" title="Vis.js" align="center" height="30" /></a>
220229
- <a href="#"><img src="assets/plotly-logo-color.png" alt="Plotly.js" title="Plotly.js" align="center" height="30" /></a>
221230
- <a href="#"><img src="assets/pngwing.com.png" alt="Apache Kafka" title="Apache Kafka" align="center" height="30" /></a>
231+
- <a href="#"><img src="assets/grafana-logo.png" alt="Grafana" title="Grafana" align="center" height="40" /></a>
232+
- <a href="#"><img src="assets/selenium-logo.png" alt="Selenium" title="Selenium" align="center" height="30" /></a>
233+
- <a href="#"><img src="assets/prometheus-logo.png" alt="Prometheus" title="Prometheus" align="center" height="40" /></a>
234+
- <a href="#"><img src="assets/github-action-logo.png" alt="Github Action" title="Github Action" align="center" height="40" /></a>
235+
- <a href="#"><img src="assets/threeJS-logo.png" alt="Github Action" title="Github Action" align="center" height="40" /></a>
236+
- <a href="#"><img src="assets/kubernetes-log.png" alt="Kubernetes" title="Kubernetes" align="center" height="40" /></a>
237+
238+
222239

223240

224241
## License

__backend-tests__/jest.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
// Code coverage settings
88
collectCoverage: true,
99
coverageDirectory: 'coverage',
10-
// Specify the test path patterns to ignore (frontend tests)
11-
testPathIgnorePatterns: ['/node_modules/', '/__tests__/'],
12-
testTimeout: 40000
10+
// Specify the test path files/patterns to ignore
11+
testPathIgnorePatterns: ['/node_modules/', '/__tests__/', '/__backend-tests__/mongo.test.js'],
1312
};

__backend-tests__/mongo.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//Issues with mongo memory server causing timeout for each test. Change file type from .txt to .js to run
2+
3+
14
const mongoose = require('mongoose');
25
const mongo = require('../chronos_npm_package/controllers/mongo');
36
const ServicesModel = require('../chronos_npm_package/models/ServicesModel');

__tests__/charts/HealthChart.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//BELOW test cases are only for instances of REACT Plotly, which is currently on microservices, gRPC and AWS. Change file from .txt to .tsx to run test
2+
13
import React from 'react';
24
import HealthChart from '../../app/charts/HealthChart';
35
import { render, screen } from '@testing-library/react';

__tests__/components/About.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ describe('About Page', () => {
1414
element = screen.getByTestId('aboutPage');
1515
});
1616

17-
it('Should have three p tags', () => {
18-
expect(element.querySelectorAll('p').length).toBe(6);
19-
});
17+
// it('Should have three p tags', () => {
18+
// expect(element.querySelectorAll('p').length).toBe(6);
19+
// });
2020

2121
it('Should have three h3 tags', () => {
2222
expect(element.querySelectorAll('h3').length).toBe(3);

app/charts/GrafanaEventChart.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ interface EventChartProps {
77
token: string;
88
}
99

10-
// interface SoloStyles {
11-
// height: number;
12-
// width: number;
13-
// }
1410

1511
type TimeFrame = '5m' | '15m' | '30m' | '1h' | '2h' | '1d' | '2d';
1612

@@ -27,16 +23,10 @@ const GrafanaEventChart: React.FC<EventChartProps> = React.memo(props => {
2723
const [type, setType] = useState(['timeserie']);
2824
const [timeFrame, setTimeFrame] = useState('5m');
2925

30-
// const [solo, setSolo] = useState<SoloStyles | null>(null);
3126
console.log("graphType: ", graphType)
3227
console.log("type: ", type)
3328
console.log("inside GrafanaEventChart")
3429

35-
// setInterval(() => {
36-
// if (solo !== soloStyle) {
37-
// setSolo(soloStyle);
38-
// }
39-
// }, 20);
4030
console.log("metricName: ", metricName)
4131
let uid = metricName.replace(/.*\/.*\//g, '')
4232
if (uid.length >= 40) {
@@ -48,7 +38,6 @@ const GrafanaEventChart: React.FC<EventChartProps> = React.memo(props => {
4838
console.log("parsedName: ", parsedName)
4939

5040
const handleSelectionChange = async (event) => {
51-
//setGraphType(event.target.value);
5241
setType([...type, graphType]);
5342
await fetch('http://localhost:1111/api/updateDashboard', {
5443
method: 'POST',

app/containers/EventContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const EventContainer: React.FC<EventContainerProps> = React.memo(props => {
124124
// }
125125
}
126126
}
127+
// currently, we only display graph using grafana. It can be implement as a option to choose between ploty and grafana for future iterations
127128
// if (isGrafana) {
128129
console.log(grafanaChartsArray)
129130
setEventChartsArr(grafanaChartsArray);

0 commit comments

Comments
 (0)