Skip to content

A microservices-based uptime monitoring system built with Python (Flask) and MySQL. Features a decoupled architecture with a dedicated "Watcher" service for asset management and a "Logger" service for historical telemetry persistence.

Notifications You must be signed in to change notification settings

Pranee-2212/Distributed-Asset-Health-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Distributed Asset Health Monitor

A lightweight Microservice-based system designed to monitor the uptime and latency of digital assets (websites/APIs) in real-time.


πŸ— Architecture Overview

The project is architectured as two decoupled services to ensure scalability and professional separation of concerns:

  • Watch (Service A): The "Brain" of the operation. It handles the Asset Registry (CRUD) and serves as the execution engine for health checks and pings.
  • Logger (Service B): The "Historian." A dedicated service that receives telemetry data from Service A and persists it into a MySQL database.

πŸš€ Key Features

  • Dynamic Asset Management: Add or remove target URLs in real-time via the web dashboard.
  • Health Telemetry: Captures HTTP status codes and precise round-trip latency (ms).
  • Decoupled Communication: Services communicate via RESTful JSON payloads, preventing database bottlenecks.
  • Database Driven: Uses dedicated schemas for asset configurations and historical logs.

πŸ›  Tech Stack

  • Languages: Python 3.x, JavaScript (ES6+)
  • Frameworks: Flask (Python), Vanilla JS (Frontend)
  • Database: MySQL 8.0
  • Protocols: HTTP/REST, JSON

πŸ“‚ Project Structure

As seen in the project root:

.
β”œβ”€β”€ Logger/                  # Service B: Data Persistence & History
β”‚   β”œβ”€β”€ Service_B.py
β”‚   └── .env                 # DB Credentials for history_db
β”œβ”€β”€ Watch/                   # Service A: Asset Management & Pings
β”‚   β”œβ”€β”€ Service_A.py
β”‚   └── .env                 # DB Credentials for monitor_db
β”œβ”€β”€ templates/               # Frontend UI
β”‚   └── index.html           # Dashboard Interface
β”œβ”€β”€ .gitignore               # Excludes venv, __pycache__, and .env
β”œβ”€β”€ DB_SCHEM.sql             # MySQL Database Setup Scripts
β”œβ”€β”€ README.md                # Project Documentation
└── requirements.txt         # Global Python Dependencies

🚦 Getting Started

  1. Database Configuration Initialize your databases by running the provided SQL script:
-- Open your MySQL terminal or Workbench and run:
source DB_SCHEM.sql

##2. Environment Setup You must have a .env file in both the /Logger and /Watch directories:

DB_HOST=localhost
DB_USER=your_username
DB_PASSWORD=your_password
  1. Installation Install the necessary libraries using the global requirements file:
pip install -r requirements.txt

About

A microservices-based uptime monitoring system built with Python (Flask) and MySQL. Features a decoupled architecture with a dedicated "Watcher" service for asset management and a "Logger" service for historical telemetry persistence.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published