|
1 | 1 | ## 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 |
2 | 5 | - Bug Fixes
|
3 | 6 | - 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 | + |
7 | 8 | #
|
8 | 9 |
|
9 | 10 | ## Features
|
|
12 | 13 | - Displays real-time temperature, speed, latency, and memory statistics
|
13 | 14 | - Display and compare multiple microservice metrics in a single graph
|
14 | 15 | - 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 |
16 | 17 |
|
17 | 18 | #
|
18 | 19 |
|
@@ -54,10 +55,18 @@ module.exports = {
|
54 | 55 | mode: 'kubernetes',
|
55 | 56 | promService: 'prometheus-service',
|
56 | 57 | promPort: 8080,
|
| 58 | + grafanaAPIKey: process.env.CHRONOS_GRAFANA_API_KEY, |
57 | 59 |
|
58 | 60 | // (c) Apache Kafka
|
59 | 61 | mode: 'kafka',
|
60 | 62 | 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 | + |
61 | 70 | /* USE ONE OF THE MODE-SPECIFIC CONFIGURATIONS ABOVE */
|
62 | 71 |
|
63 | 72 | // Notifications
|
@@ -87,7 +96,7 @@ The `database` property is required and takes in the following:
|
87 | 96 | - `type` should be a string and only supports 'MongoDB' and 'PostgreSQL' at this time
|
88 | 97 | - `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
|
89 | 98 |
|
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. |
91 | 100 |
|
92 | 101 | 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.
|
93 | 102 |
|
@@ -269,6 +278,40 @@ When viewing your information in the Chronos Electron application the data will
|
269 | 278 |
|
270 | 279 | **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.
|
271 | 280 |
|
| 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 | + |
272 | 315 | ### Chronos Tracker for gRPC
|
273 | 316 |
|
274 | 317 | 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`.
|
|
0 commit comments