Skip to content

Commit 5ecc4c2

Browse files
committed
modified
1 parent 621b474 commit 5ecc4c2

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"parent":"7ce5bbc3-ccce-4f76-a001-595a6a22ccc5","pid":46687,"argv":["/Users/eishakaushal/.nvm/versions/node/v18.16.0/bin/node","/Users/eishakaushal/Chronos/node_modules/.bin/tsc"],"execArgv":[],"cwd":"/Users/eishakaushal/Chronos","time":1692737594551,"ppid":46686,"coverageFilename":"/Users/eishakaushal/Chronos/.nyc_output/6afafb04-53de-4650-8a6f-e99dbdd3dee9.json","externalId":"","uuid":"6afafb04-53de-4650-8a6f-e99dbdd3dee9","files":[]}

chronos_npm_package/README.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
## What's New?
2+
- Enhanced Metrics Collection: Docker now supports Prometheus metrics scraping, offering improved monitoring capabilities
3+
- Streamlined Visualization: Docker and Kubernetes integrate with Grafana to provide dynamic visualization of collected metrics
4+
- Ability to select graph type and process kubernetes resource data
25
- Bug Fixes
36
- Refactored code for additional modularity and customization
4-
- Ability for developers to increase number of metrics monitored for microservices
5-
- Connected to Grafana interface.
6-
- Ability to select graph type and process kubernetes resource data
7+
78
#
89

910
## Features
@@ -12,7 +13,7 @@
1213
- Displays real-time temperature, speed, latency, and memory statistics
1314
- Display and compare multiple microservice metrics in a single graph
1415
- Monitor an Apache Kafka cluster via the JMX Prometheus Exporter
15-
- Monitor Docker and Kubernetes cluster via a Prometheus monitoring server and display charts using Grafana
16+
- Monitor Docker and Kubernetes clusters via a Prometheus monitoring server and display charts using Grafana
1617

1718
#
1819

@@ -54,10 +55,18 @@ module.exports = {
5455
mode: 'kubernetes',
5556
promService: 'prometheus-service',
5657
promPort: 8080,
58+
grafanaAPIKey: process.env.CHRONOS_GRAFANA_API_KEY,
5759

5860
// (c) Apache Kafka
5961
mode: 'kafka',
6062
jmxuri: '<insert URI>',
63+
64+
// (d) Docker
65+
mode: 'docker',
66+
promService: 'docker.for.mac.localhost',
67+
promPort: 9090,
68+
grafanaAPIKey: process.env.CHRONOS_GRAFANA_API_KEY,
69+
6170
/* USE ONE OF THE MODE-SPECIFIC CONFIGURATIONS ABOVE */
6271

6372
// Notifications
@@ -87,7 +96,7 @@ The `database` property is required and takes in the following:
8796
- `type` should be a string and only supports 'MongoDB' and 'PostgreSQL' at this time
8897
- `URI` should be a connection string to the database where you intend Chronos to write and record data regarding health, HTTP route tracing, and container infomation
8998

90-
The `mode` property accepts a string that can either be 'microservices', 'kubernetes', or 'kafka'. There are other settings that depend on the mode choice, so these are broken down in the "Chronos Tracker for Microservices" section.
99+
The `mode` property accepts a string that can either be 'microservices', 'kubernetes', 'kafka', or 'docker'. There are other settings that depend on the mode choice, so these are broken down in the "Chronos Tracker for Microservices" section.
91100

92101
The `notifications` property is an array that can be optionally left empty. It 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.
93102

@@ -269,6 +278,40 @@ When viewing your information in the Chronos Electron application the data will
269278

270279
**NOTE:** We provide a jmx_config.yaml file in the Chronos root folder for use with JMX prometheus that provides some useful baseline metrics to monitor.
271280

281+
### Chronos Tracker for "docker" Mode
282+
Chronos can monitor Docker containers by saving metric data from instant queries to a Prometheus server in your Docker container.
283+
284+
In `chronos-config.js`, set the `mode` to `docker` and pass it both the name of the port the Prometheus server is listening on INSIDE the container, and the name of the Prometheus service so that its IP address can be resolved using DNS.
285+
286+
Also add a `grafanaAPIKey` section, this API key will grant chronos access to create and update dashboards in Grafana.
287+
288+
```js
289+
// Excerpt from a chronos-config.js
290+
291+
module.exports = {
292+
// ...
293+
294+
mode: 'docker',
295+
promService: 'docker.for.mac.localhost',
296+
promPort: 8080,
297+
298+
grafanaAPIKey: process.env.CHRONOS_GRAFANA_API_KEY,
299+
300+
// ...
301+
}
302+
303+
```
304+
305+
Then, insert the code below into a **SINGLE** microservice that will be deployed only as a **SINGLE** container, call `Chronos.docker`:
306+
307+
```js
308+
const chronosConfig = require('./chronos-config.js');
309+
const Chronos = require('@chronosmicro/tracker');
310+
const chronos = new Chronos(chronosConfig);
311+
312+
chronos.docker();
313+
```
314+
272315
### Chronos Tracker for gRPC
273316

274317
To monitor your gRPC server, setup `chronos-config.js` as if it was a standard microservices example, but be sure to set the `connection` type to `gRPC`.

chronos_npm_package/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)