Skip to content

Commit 2fa3047

Browse files
Update README
1 parent 4e31902 commit 2fa3047

File tree

1 file changed

+80
-67
lines changed

1 file changed

+80
-67
lines changed

README.md

Lines changed: 80 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -27,54 +27,36 @@
2727
- Temperature, speed, latency, and memory tracking
2828
- Process monitoring
2929

30-
# Quick start
30+
## Quick start
3131

32-
Install dependencies
32+
### Install dependencies
3333

3434
```
3535
npm install chronos-tracker
3636
```
3737

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

4040
```js
41+
// An example `chronos-config.js` file
42+
4143
const chronos = require('chronos-tracker');
4244

43-
cmd.use({
44-
microservice: 'chronos-mon-2',
45-
interval: 3000,
45+
chronos.use({
46+
microservice: 'payments',
47+
interval: 2000,
4648
dockerized: true,
4749
database: {
4850
type: 'MongoDB',
49-
URI: /* NEW DATABASE URI */,
51+
URI: process.env.MONGO_URI,
5052
},
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-
],
53+
notifications: [],
6954
});
7055
```
7156

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_
57+
**More information on configuring Chronos and setting up notifications below**
7658

77-
Initialize chronos
59+
### Initialize chronos
7860

7961
```js
8062
const cmd = require('chronos-tracker');
@@ -84,14 +66,14 @@ cmd.propagate();
8466
app.use('/', cmd.track());
8567
```
8668

87-
Download Chronos to view your application data [here]()
69+
**Download Chronos** to start monitoring your application data [here]()
8870

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

@@ -111,25 +93,76 @@ volumes:
11193
\*Note: This module leverages the features of [systeminformation](https://systeminformation.io/).
11294

11395

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
96+
## Configuration
97+
98+
The `microservice` property takes in a string. This should be the name of your server or microservice. For **Docker** containers, the same name of the microservice should reflect the name of the corresponding Docker container.
99+
100+
The `interval` property is optional and takes in an integer in milliseconds. This controls the monitoring frequency between data points. If this is omitted, Chronos will defualt to recording server health every 2000 ms or 2 seconds.
101+
102+
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.
103+
104+
The `database` property is required. T takes in the following:
105+
- `type` which should be a string and only supports 'MongoDB' and 'PostgreSQL'.
106+
- `URI` which should be a connection string the database you intend Chronos to write and record data regarding health, communication, and container infomation to. A `.env` is recommended.
107+
129108
- [6] isDockerized: Is this microservice running in a Docker container? Enter "yes" or "no". (Defaults to "no".)
130109
- 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.
131110
- Don't forget to bind mount to Docker socket. See NEW FEATURE section above.
132111

112+
## Notifications
113+
114+
The `notifications` property is optional and allows developers to set up notifications when the monitored server responds to request 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.
115+
116+
Chronos only supports Slack and email notifications.
117+
118+
### Slack
119+
120+
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.
121+
122+
An example of configured **slack** settings:
123+
124+
```js
125+
// ...
126+
notifications: [
127+
{
128+
type: 'email',
129+
settings: {
130+
slackurl: process.env.WEBHOOK
131+
}
132+
}
133+
]
134+
// ...
135+
```
136+
137+
### Email
138+
139+
Chronos provides the option to send emails. The properties that should be provided are the following
140+
- `emails` - The recipient list (string) can be a single email address or multiple as comma seprated values.
141+
- `emailHost` - The smtp host (string) of your email server
142+
- `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/)
143+
- `user` - The email address (string) of the sender
144+
- `password` - The password (string) of the sender email
145+
146+
_NOTE: Email notification settings may require alternative security settings to work_
147+
148+
An example of configured **email** settings:
149+
150+
```js
151+
// ...
152+
notifications: [
153+
{
154+
type: 'email',
155+
settings: {
156+
157+
emailHost: '[email protected]',
158+
emailPort: 465,
159+
user: process.env.SENDER_EMAIL,
160+
password: process.env.SENDER_PASSWORD
161+
}
162+
}
163+
]
164+
// ...
165+
```
133166

134167
## Microservice Test Suite
135168

@@ -151,26 +184,6 @@ Development of Chronos is open source on GitHub through the tech accelerator umb
151184

152185
- [Contributing Guide](https://github.com/oslabs-beta/Chronos/CONTRIBUTING.md)
153186

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)
173-
174187
## License
175188

176189
Chronos is [MIT licensed.](https://github.com/oslabs-beta/Chronos/blob/master/LICENSE.md)

0 commit comments

Comments
 (0)