Skip to content

Commit 6823eff

Browse files
Merge pull request #33 from oslabs-beta/master
Update README
2 parents b5d4740 + f0db06e commit 6823eff

File tree

2 files changed

+107
-71
lines changed

2 files changed

+107
-71
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing
2+
3+
Chronos encourages contributions to this product.
4+
5+
## Pull Requests
6+
7+
Chronos welcomes all pull requests.
8+
9+
1. Fork the repo and create a working branch from `master`.
10+
2. If you've added any code that requires testing, add tests.
11+
3. If you've changed APIs, update the `README.md`.
12+
4. Check to ensure that all tests pass.
13+
5. Make sure code is formatted with `prettier` and follows the [Airbnb React/JSX Style Guide](https://github.com/airbnb/javascript/blob/master/react/README.md).
14+
6. Create a pull request to `master`.
15+
16+
## Issues
17+
18+
Please do not hesitate to file issues. Chronos is based off of community feedback and is always looking for ways to get better. The team behind Chronos is interested to hear about your experience and how we can improve it.
19+
20+
Please do not hesitate to submit issues that promote bugs or offer ways to enhance to Chronos. When submitting issues, ensure your description is clear and has instructions to be able to reproduce the issue.
21+
22+
## Get in touch
23+
24+
We use GitHub as a platform of communication between users and developers to promote transparency. We thrive off of the community support and feedback

README.md

Lines changed: 83 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Chronos
1010

11-
> A developer tool that monitors the health and web traffic of servers, microservices, and containers.
11+
A developer tool that monitors the health and web traffic of servers, microservices, and containers.
1212

1313
## NEW FEATURES FOR 4.0+ - Real-time Data and Docker Container Stats
1414

@@ -26,55 +26,38 @@
2626
- Docker container stats (e.g. ID, memory usage %, CPU usage %, running processes, etc.)
2727
- Temperature, speed, latency, and memory tracking
2828
- Process monitoring
29+
- HTTP route tracing
2930

30-
# Quick start
31+
## Quick start
3132

32-
Install dependencies
33+
#### Install dependencies
3334

3435
```
3536
npm install chronos-tracker
3637
```
3738

38-
Create `chronos-config.js` within the **same directory** as your `server.js`
39+
#### Create a `chronos-config.js`
3940

4041
```js
42+
// An example `chronos-config.js` file
43+
4144
const chronos = require('chronos-tracker');
4245

43-
cmd.use({
44-
microservice: 'chronos-mon-2',
45-
interval: 3000,
46+
chronos.use({
47+
microservice: 'payments',
48+
interval: 2000,
4649
dockerized: true,
4750
database: {
4851
type: 'MongoDB',
49-
URI: /* NEW DATABASE URI */,
52+
URI: process.env.MONGO_URI,
5053
},
51-
notifications: [
52-
{
53-
type: 'slack',
54-
settings: {
55-
slackurl: /* YOUR SLACK WEBHOOK URL*/,
56-
},
57-
},
58-
{
59-
type: 'email',
60-
settings: {
61-
emails: /* EMAIL RECIPIENT LIST */,
62-
emailHost: /* EMAIL HOST */,
63-
emailPort: /* EMAIL PORT */,
64-
user: /* SENDER EMAIL ADDRESS */,
65-
password: process.env.EMAIL_PASSWORD,
66-
},
67-
},
68-
],
54+
notifications: [],
6955
});
7056
```
7157

72-
Refer to section setup for more information on these properties
73-
74-
75-
_NOTE: Email notification settings may require alternative security settings to work_
58+
**More information on configuring Chronos and setting up notifications below**
7659

77-
Initialize chronos
60+
#### Initialize chronos
7861

7962
```js
8063
const cmd = require('chronos-tracker');
@@ -84,14 +67,13 @@ cmd.propagate();
8467
app.use('/', cmd.track());
8568
```
8669

87-
Download Chronos to view your application data [here]()
88-
70+
**Download Chronos** to start monitoring your application data [here]()
8971
<!-- # Installation
9072
9173
Chronos consists of a [Node](https://nodejs.org/en/) module available through the
9274
[npm registry](https://www.npmjs.com/) and a lightweight [Electron](https://electronjs.org/) desktop application. -->
9375

94-
# Containerized Applications Using Docker
76+
## Docker - Containerized Applications
9577

9678
IMPORTANT: Give your containers the same names you use for arguments for microservice names. Read more about it under the INSTALLATION section below.
9779

@@ -110,26 +92,76 @@ volumes:
11092

11193
\*Note: This module leverages the features of [systeminformation](https://systeminformation.io/).
11294

95+
## Configuration
96+
97+
The `microservice` property takes in a string. This should be the name of your server or microservice. For **Docker** containers, the name of the microservice should be the same as the name of the corresponding Docker container.
98+
99+
The `interval` property is optional and takes in an integer. This controls the Chronos monitoring frequency. If this is omitted, Chronos will defualt to recording server health every 2000 ms or 2 seconds.
100+
101+
The `dockerized` property is optional and should be specified as `true` if the server is running inside of a Docker container. Otherwise, this should be `false`. If omitted, Chronos will assume this server is not running in a container.
102+
103+
The `database` property is required and takes in the following:
104+
- `type` which should be a string and only supports 'MongoDB' and 'PostgreSQL'.
105+
- `URI` which should be a connection string the database you intend Chronos to write and record data regarding health, HTTP route tracing, and container infomation to. A `.env` is recommended.
113106

114-
## Configuration Setup
115-
116-
- [1] microserviceName: To identify the microservice (i.e. "payments").
117-
- Make sure this name matches your container name. More details more below (param #6).
118-
- Your input name for the microservice will be turned to an all-lowercase string.
119-
- [2] databaseType: Enter either "mongo" or "sql".
120-
- [3] databaseURL: Enter the URL of your database.
121-
- [4] wantMicroHealth: Do you want to monitor the health of this microservice? Enter "yes" or "no".
122-
- Note: If you choose "yes" for this param, the middleware will NOT log container stats. In other words, if you want container stats instead, input "no" here and "yes" for param #6.
123-
- [5] queryFrequency (optional): How frequently do you want to log the health of this microservice? It defaults to every minute, but you can choose:
124-
- "s" : every second
125-
- "m" : every minute (default)
126-
- "h" : every hour
127-
- "d" : once per day
128-
- "w" : once per week
129107
- [6] isDockerized: Is this microservice running in a Docker container? Enter "yes" or "no". (Defaults to "no".)
130108
- IMPORTANT: When starting up the container, give it the same name that you used for the microservice, because the middleware finds the correct container ID of your container by matching the container name to the microservice name you input as 1st argument.
131109
- Don't forget to bind mount to Docker socket. See NEW FEATURE section above.
132110

111+
## Notifications
112+
113+
The `notifications` property is optional and allows developers to be alerted when the server responds to requests with status codes >= 400. To set up notifications, set the value of the `notifications` property to an array of objects, each with a `type` and `settings` property.
114+
115+
Chronos only supports **Slack** and **email** notifications.
116+
117+
### Slack
118+
119+
Chronos uses the **Slack API** to send messages to a Slack channel and only requires the **webhook url**. Learn how to set up [Slack webhooks](https://api.slack.com/messaging/webhooks) for your team.
120+
121+
An example of configured **slack** settings:
122+
123+
```js
124+
// ...
125+
notifications: [
126+
{
127+
type: 'email',
128+
settings: {
129+
slackurl: process.env.WEBHOOK
130+
}
131+
}
132+
]
133+
// ...
134+
```
135+
136+
### Email
137+
138+
Chronos provides the option to send emails. The properties that should be provided are the following
139+
- `emails` - The recipient list (string) can be a single email address or multiple as comma seprated values.
140+
- `emailHost` - The smtp host (string) of your email server
141+
- `emailPort` - The email port (integer) is either **465** or **587** depending on the sender email security settings. Learn more about email ports at the [nodemailer docs](https://nodemailer.com/smtp/)
142+
- `user` - The email address (string) of the sender
143+
- `password` - The password (string) of the sender email
144+
145+
_NOTE: Email notification settings may require alternative security settings to work_
146+
147+
An example of configured **email** settings:
148+
149+
```js
150+
// ...
151+
notifications: [
152+
{
153+
type: 'email',
154+
settings: {
155+
156+
emailHost: '[email protected]',
157+
emailPort: 465,
158+
user: process.env.SENDER_EMAIL,
159+
password: process.env.SENDER_PASSWORD
160+
}
161+
}
162+
]
163+
// ...
164+
```
133165

134166
## Microservice Test Suite
135167

@@ -139,7 +171,7 @@ The microservices include individual Dockerfiles in their respective directories
139171

140172
Refer to the [README](https://github.com/oslabs-beta/Chronos/tree/docker/microservice) of that branch for more details.
141173

142-
#### Electron desktop application
174+
## Electron desktop application
143175

144176
After installing the node module in each microservice, download the Electron desktop application from the public [Chronos]() repo.
145177

@@ -149,27 +181,7 @@ Inside the downloaded directory, install all dependencies using the `npm install
149181

150182
Development of Chronos is open source on GitHub through the tech accelerator umbrella OS Labs, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Chronos.
151183

152-
- [Contributing Guide](https://github.com/oslabs-beta/Chronos/CONTRIBUTING.md)
153-
154-
## People
155-
156-
[Tim Atapagra](https://github.com/timpagra),
157-
[Todd Buckner](https://github.com/tdwolf6),
158-
[Brian Bui](https://github.com/Umius-Brian),
159-
[Ronelle Caguioa](https://github.com/ronellecaguioa),
160-
[Mohtasim Chowdhury](https://github.com/mohtasim317),
161-
[Ousman Diallo](https://github.com/Dialloousman),
162-
[Michelle Herrera](https://github.com/mesherrera),
163-
[Alan Lee](https://github.com/ajlee12/),
164-
[Duane McFarlane](https://github.com/Duane11003),
165-
[Ben Mizel](https://github.com/ben-mizel),
166-
[Alon Ofengart](https://github.com/alon25),
167-
[Greg Palasciano](https://github.com/gregpalace),
168-
[Jenae Pennie](https://github.com/jenaepen),
169-
[Chris Romano](https://github.com/robicano22),
170-
[Brianna Sookhoo](https://github.com/briannasookhoo),
171-
[Natalie Umanzor](https://github.com/nmczormick),
172-
[Michael Wang](https://github.com/wang3101)
184+
- [Contributing](https://github.com/oslabs-beta/Chronos/blob/master/CONTRIBUTING.md)
173185

174186
## License
175187

0 commit comments

Comments
 (0)