Coder Social home page Coder Social logo

chetanxpro / event-pilot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 118 KB

A real-time monitoring system that tracks and analyzes events across various services, powered by Kafka and MongoDB.

License: MIT License

JavaScript 10.46% TypeScript 87.48% Shell 1.66% CSS 0.40%
analytics event-monitoring kafka kafka-streams mongodb real-time-analytics realtime-monitoring

event-pilot's Introduction

EventPilot

EventPilot is a dynamic platform designed for real-time monitoring and analysis of service events. Utilizing Kafka for event handling and MongoDB for data storage, the architecture allows seamless integration of new monitoring services through a base abstract class.

Key Components

  • /monitor-service: Monitors events from different services.
  • /kafka-admin: Manages Kafka server setup and creates topics for monitoring.
  • /admin-dashboard: A Next.js frontend that displays near-real-time charts for login failures.

Architecture Overview

The system's modular architecture enables easy expansion. Services extending the BaseMonitoringService abstract class inherit methods for connecting to Kafka, subscribing to topics, and processing messages.

BaseMonitoringService

Serves as the backbone for all monitoring services, providing essential functionalities such as:

  • Kafka connection and subscription management.
  • MongoDB integration for data persistence.
  • Abstract processMessage method to be implemented by each service for specific logic.

LoginFailureMonitoringService

This service monitors login attempts, evaluating and responding to login failures. It exemplifies how to implement specific logic on top of the BaseMonitoringService.

Getting Started

Prerequisites

  • Node.js
  • Docker
  • Kafka (set up via Docker-compose)

Setup and Running

You can start the services either manually or by using the provided shell script.

Using the Shell Script

In the root directory, execute the start-dev.sh script:

./start-dev.sh

This script automates the following tasks:

  • Starts Kafka and Zookeeper using Docker.
  • Waits for Kafka to be ready.
  • Starts the Node.js monitoring service.

Manual Setup

Kafka Setup

Navigate to the kafka-admin directory and run:

docker-compose up -d

Start Monitor Service

From the monitor-service directory:

npm install
npm run dev

Usage

Once the services are operational, the system will actively monitor specified events. Results are logged and stored, with alerts based on predefined conditions.

Alerts

  • Alerts can be configured to be sent through different channels such as Slack or Discord, depending on the severity and type of event detected. Ensure your alert channels are properly configured in the BaseMonitoringService for effective notifications.

Extending the System

To add a new monitoring service:

  1. Extend the BaseMonitoringService class.
  2. Implement the processMessage method with your custom logic.
  3. Configure Kafka topics as needed.

Example template for a new service:

import BaseMonitoringService from './BaseMonitoringService';

class CustomMonitoringService extends BaseMonitoringService {
    protected processMessage(payload) {
        // Insert custom processing logic here.
    }
}

Contributing

Contributions are welcome! Please fork the repository and submit pull requests with your enhancements or fixes.

event-pilot's People

Contributors

chetanxpro avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.