All Projects → open-source-labs → Chronos

open-source-labs / Chronos

Licence: mit
📊 📊 📊 Monitors the health and web traffic of servers, microservices, and containers with real-time data monitoring and receive automated notifications over Slack or email.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Chronos

Vigil
🚦 Microservices Status Page. Monitors a distributed infrastructure and sends alerts (Slack, SMS, etc.).
Stars: ✭ 804 (+131.7%)
Mutual labels:  microservices, slack, monitoring
Alertmanager
Prometheus Alertmanager
Stars: ✭ 4,574 (+1218.16%)
Mutual labels:  slack, notifications, monitoring
Gatus
⛑ Gatus - Automated service health dashboard
Stars: ✭ 1,203 (+246.69%)
Mutual labels:  health, slack, monitoring
Health Checks Api
Standardize the way services and applications expose their status in a distributed application
Stars: ✭ 78 (-77.52%)
Mutual labels:  microservices, health, monitoring
Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (+557.35%)
Mutual labels:  microservices, monitoring, monitoring-tool
Practical.cleanarchitecture
Asp.Net Core 5 Clean Architecture (Microservices, Modular Monolith, Monolith) samples (+Blazor, Angular 11, React 17, Vue 2.6), Domain-Driven Design, CQRS, Event Sourcing, SOLID, Asp.Net Core Identity Custom Storage, Identity Server 4 Admin UI, Entity Framework Core, Selenium E2E Testing, SignalR Notification, Hangfire Tasks Scheduling, Health Checks, Security Headers, ...
Stars: ✭ 639 (+84.15%)
Mutual labels:  graphql, microservices, grpc
Swell
Swell: API development tool that enables developers to test endpoints served over streaming technologies including Server-Sent Events (SSE), WebSockets, HTTP2, GraphQL, and gRPC.
Stars: ✭ 517 (+48.99%)
Mutual labels:  graphql, grpc, monitoring
Tyk
Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Stars: ✭ 6,968 (+1908.07%)
Mutual labels:  graphql, microservices, grpc
Yarpc Go
A message passing platform for Go
Stars: ✭ 285 (-17.87%)
Mutual labels:  microservices, grpc
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+5366.57%)
Mutual labels:  graphql, grpc
Armeria
Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Stars: ✭ 3,392 (+877.52%)
Mutual labels:  microservices, grpc
Yoyogo
🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go. Support Nacos ,Consoul ,Etcd ,Eureka ,kubernetes.
Stars: ✭ 277 (-20.17%)
Mutual labels:  microservices, grpc
Graphik
Graphik is a Backend as a Service implemented as an identity-aware document & graph database with support for gRPC and graphQL
Stars: ✭ 277 (-20.17%)
Mutual labels:  graphql, grpc
Static status
🚦Bash script to generate a static status page.
Stars: ✭ 286 (-17.58%)
Mutual labels:  monitoring, monitoring-tool
Gloo
The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
Stars: ✭ 3,219 (+827.67%)
Mutual labels:  microservices, grpc
Surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service gove…
Stars: ✭ 3,088 (+789.91%)
Mutual labels:  microservices, grpc
Spidermon
Scrapy Extension for monitoring spiders execution.
Stars: ✭ 309 (-10.95%)
Mutual labels:  monitoring, monitoring-tool
Micrometer
An application metrics facade for the most popular monitoring tools. Think SLF4J, but for metrics.
Stars: ✭ 3,173 (+814.41%)
Mutual labels:  microservices, monitoring
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (-15.85%)
Mutual labels:  monitoring, monitoring-tool
A To Z List Of Useful Node.js Modules
Collection of most awesome node modules that will extend the capability of your node.js application.
Stars: ✭ 315 (-9.22%)
Mutual labels:  npm-package, npm-module
Chronos

Build Passing PRs Welcome License: MIT Release: 5.1

Chronos

⭐️ Star us on GitHub — it helps! ⭐️

Chronos is a comprehensive developer tool that monitors the health and web traffic of servers, microservices, and containers. Use Chronos to see real-time data monitoring and receive automated notifications over Slack or email.

Table of Contents

Return to Top

New Features

  • New UI Features
    • Dark and Light mode options now available across user sessions.
    • Updated charts to now also support gRPC calls
    • Integrated log to provide users with relational data on request & response cycle
  • Bug Fixes
    • Fixed bug where users could only connect to one MongoDB database and would see its microservices listed even when users clicked on applications using other MongoDB databases
  • Chronos now support monitoring for gRPC!
    • Distributed tracing across network request
    • Currently chronos gRPC tracing for MongoDB and PostgresQL

Features

  • Distributed tracing enabled across microservices applications
  • Compatible with GraphQL
  • Provides Docker container stats (e.g. ID, memory usage %, CPU usage %, running processes, etc.)
  • Supports PostgreSQL and MongoDB databases
  • Displays real-time temperature, speed, latency, and memory statistics

Return to Top

Demo

Chronos-Demo

Return to Top

Installation

This is for the latest Chronos version 5.1 release and later.

  • Stable release: 6.1.0
  • LTS release: 6.1.0

Pre-Installation

Make sure you're running version 12.18.3 of Node, which is the most recent LTS (long-term support) version.

If you need to roll back from Node 14.9.0, make sure to run npm rebuild in the root directory.

If you're installing Chronos into a microservices application, and you have different folders for each microservice, make sure you also run npm rebuild in each microservices folder after you roll back to version 12.18.3.

Install Dependencies

To use Chronos in your existing application, download and install the following in the root directory of each of your microservice applications:

npm install chronos-tracker

Configure Chronos Tracker

Similarly, in the root directory of each of your microservice applications, create a chronos-config.js file with properties listed below:

// A sample `chronos-config.js` file

const chronos = require('chronos-tracker');

chronos.use({
  microservice: 'payments',
  interval: 2000,
  dockerized: true,
  database: {
    connection: 'REST',
    type: 'MongoDB',
    URI: process.env.URI,
  },
  notifications: [],
});

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.

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.

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.

The database property is required and takes in the following:

  • connection which should be a string and only supports 'REST' and 'gRPC'
  • type which should be a string and only supports 'MongoDB' and 'PostgreSQL'.
  • 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.

The notifications property is optional. Jump to the section below, Notifications to configure Slack or email Slack notifications.

Initialize Chronos Tracker

Initialize Chronos Tracker for REST

Wherever you create an instance of your server (see example below),

// Example for REST
const express = require('express');
const app = express());

you will also need to require in chronos-tracker and initialize Chronos, as well as the ./chronos-config file. You will then need to invoke chronos.propagate() to initiate the route tracing, in addition to implementing chronos.track() for all endpoints.

const chronos = require('chronos-tracker');
require('./chronos-config'); // Bring in config file

// ...

chronos.propagate();
app.use('/', chronos.track());

You should be good to go! The last step, Docker Configuration, is only applicable if you need to configure Docker for your application.


Initialize Chronos Tracker for gRPC

Wherever you create an instance of your server (see example below),

  // Example of gRPC server
  const server = new grpc.Server();

  server.bindAsync("127.0.0.1:30044", grpc.   ServerCredentials.createInsecure(), () => {
    server.start();
    console.log("Server running at http://127.0.0.1:30044");
});

you will also need to require Chronos-tracker, Chronos-config, and dotenv.config(if this is used). For health data simply use Chronos.track()

//track health data
const chronos = require('chronos-tracker');
require('./chronos-config');
require('dotenv').config(); // set up environment variables in .env
const BookModel = require('./BookModel');

chronos.track()

To trace requests, first wrap the gRPC client using Chronos

const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const chronos = require('chronos');

const PROTO_PATH = './order.proto';

const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
  keepCase: true,
  longs: String,
  enums: String,
  arrays: true,
});
const OrderToBookService = grpc.loadPackageDefinition(packageDefinition).OrderToBook;
const bookClient = new OrderToBookService('localhost:30044', grpc.credentials.createInsecure());

const ClientWrapper = chronos.ClientWrapper(bookClient, OrderToBookService);

Next wrap the gRPC server using Chronos

  const ServerWrapper = chronos.ServerWrapper(server,  Proto.protoname.service, {
    AddBook: (call, callback) => {
    // console.log(call.metadata)
    // get the properties from the gRPC client call
      const { title, author, numberOfPages, publisher, bookID } = call.request;
    // create a book in our book collection
      BookModel.create({
        title,
        author,
        numberOfPages,
        publisher,
        bookID,
      });
      callback(null, {});
    },
  });
})

For any request you wish to trace, require uuidv4 and write the following code where the initial gRPC request begins,

const require { v4: uuidv4} = require('uuid')
const createMeta = () => {
  const meta = new grpc.Metadata();
  meta.add('id', uuidvd());
  return meta
}

and then invoke createMeta as a third argument to any client method that is the beginning of the request path.

orderClient.AddOrder(
    order,
    (err, data) => {
      if (err !== null) {
        console.log(err);
        // could not add order because bookID does not exist
        return res.sendStatus(404);
      }
      console.log('addOrder response: ', data);
      return res.sendStatus(200);
    },
    createMeta()
  );

Finally, on all servers that will be involved in the request path, invoke chronos.link with parameters of client and ServerWrapper in the server wrapper.

chronos.link(client, ServerWrapper);

Docker Configuration

Again, this step is only applicable if you are currently using Docker containers for your microservices.

Important Give your containers the same names you pass as arguments for microservice names.

Important In order to have container stats saved to your database, along with other health info, bind volumes to this path when starting up the containers:

/var/run/docker.sock

For example, you can type the following when starting up a container:

docker run -v /var/run/docker.sock:/var/run/docker.sock [your-image-tag]

If you're using docker-compose to start up multiple containers, you can add a volumes key for each of your services in the docker-compose.yml file:

volumes:
  - "/var/run/docker.sock:/var/run/docker.sock"

Start Chronos

Once you have configured and intialized Chronos Tracker, it will be automatically recording monitoring data when your servers are running. Finally, start the Chronos desktop app to view that data! After cloning our GitHub repo, run npm install and npm run both to start Chronos. Alternatively, you can download an executable for Mac. Add your application in the Chronos app dashboard with the same URI you used in your Chronos Tracker configuration. Click on it and start monitoring!

Return to Top

Notifications

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.

Chronos only supports Slack and email notifications.

Slack

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 for your team.

An example of configured slack settings:

// ...
notifications: [
  {
    type: 'email',
    settings: {
      slackurl: process.env.WEBHOOK
    }
  }
]
// ...

Email

Chronos provides the option to send Slack emails. The properties that should be provided are the following

  • emails - The recipient list (string) can be a single email address or multiple as comma seprated values.
  • emailHost - The smtp host (string) of your email server
  • emailPort - The email port (integer) is either 465 or 587 depending on the sender email security settings. Learn more about email ports by reading the nodemailer docs
  • user - The email address (string) of the sender
  • password - The password (string) of the sender email

NOTE: Email notification settings may require alternative security settings to work

An example of configured email settings:

// ...
notifications: [
  {
    type: 'email',
    settings: {
      emails: '[email protected], [email protected]',
      emailHost: '[email protected]',
      emailPort: 465,
      user: process.env.SENDER_EMAIL,
      password: process.env.SENDER_PASSWORD
    }
  }
]
// ...

Return to Top

Branches

Master Branch

The 'master' branch of this repository is where the Electron application for Chronos is deployed. The Chronos monitoring tool includes two database examples, one PostgresQL and one MongoDB, with sample data sets.

NOTE: To replace or delete these two databases, simply change the database URIs stored in the following path:

root directory -> electron -> user -> settings.json

Examples

We provide two working example microservice applications in the master branch for you to test out Chronos: microservices and docker.

Microservices

In the microservices folder, we provide a sample microservice application that successfully utilizes Chronos to apply all the powerful, built-in features of our monitoring tool. You can then visualize the data with the Electron app.

Refer to the README in the microservices folder for more details.

Docker

In the Docker folder within the master branch, we provide a sample dockerized microservices application to test out Chronos and to apply distributed tracing across different containers for your testing convenience.

The docker folder includes individual Docker files in their respective directories. A docker-compose.yml is in the root directory in case you'd like to deploy all services together.

Refer to the README in the docker folder for more details.


gRPC Branch

The 'gRPC' branch is the current codebase for the NPM package, which is what you will install in your own application in order to use Chronos. Download the NPM package here.


Return to Top

Technologies

  • Electron
  • React
  • JavaScript
  • TypeScript
  • PostgreSQL
  • MongoDB
  • Node
  • Express
  • HTTP
  • gRPC
  • GraphQL
  • Docker
  • AWS
  • Jest
  • Enzyme
  • Spectron
  • Webpack
  • Material-UI
  • Vis.js
  • Plotly.js

Return to Top

Contributing

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.

Return to Top

License

Chronos is MIT licensed.

Return to Top
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].