Skip to content

Latest commit

Β 

History

54 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Failure Detector

A real-time workflow monitoring system that detects missing or delayed steps, logs every failure, and instantly alerts administrators via email β€” so issues are resolved before users are ever impacted.


πŸ“‘ Table of Contents


πŸ“– Overview

Silent Failure Detector is a full-stack application built to surface the invisible β€” workflow steps that fail without throwing any error. No crash. No exception. Just silence.

The system continuously monitors your workflow events and validates that each step arrives within its expected time window. When something is missing or delayed, it logs the failure, fires an email alert to the administrator, and keeps a full audit trail β€” so the team can investigate and resolve the issue before users are stuck.

Whether it's a payment pipeline, an order fulfillment flow, or any multi-step automated process β€” this system makes sure nothing silently slips through.


πŸš€ Features

# Feature Description
1 ⚑ Real-Time Monitoring Tracks live workflow events and validates each step within expected time windows
2 πŸ”‡ Silent Failure Detection Catches failures with no error β€” missing steps, skipped stages, and stalled transitions
3 ⏱️ Delay Detection Flags workflow steps running slower than their defined threshold
4 πŸ“§ Email Alerts Notifies administrators the moment a failure is detected
5 πŸ—“οΈ Automated Scheduler Periodically scans for overdue steps without any manual trigger
6 πŸ“Š Failure Dashboard View all failures, filter by workflow or type, and mark them resolved
7 πŸ§ͺ Event Testing Module Simulate workflow events to validate detection rules before going live
8 πŸ“ Failure Logging Every failure is logged with workflow ID, step name, and timing details

πŸ› οΈ Tech Stack

Layer Technology
Backend Spring Boot (Java)
Frontend React + TypeScript (Vite)
Database MySQL
Scheduling Spring Scheduler (@Scheduled)
Email JavaMailSender (Spring Mail)

πŸ—‚οΈ Project Structure

SilentFailureDetector/
└── demo/
    β”‚
    β”œβ”€β”€ sfd-frontend/                    # βš›οΈ  React + TypeScript Frontend (Vite)
    β”‚   β”œβ”€β”€ public/
    β”‚   β”‚   β”œβ”€β”€ image.png
    β”‚   β”‚   └── vite.svg
    β”‚   β”œβ”€β”€ src/
    β”‚   β”‚   β”œβ”€β”€ api/                     # Axios API call definitions
    β”‚   β”‚   β”œβ”€β”€ components/              # Reusable UI components
    β”‚   β”‚   β”œβ”€β”€ hooks/                   # Custom React hooks
    β”‚   β”‚   β”œβ”€β”€ pages/                   # Dashboard, Logs, Test Module pages
    β”‚   β”‚   β”œβ”€β”€ types/                   # TypeScript type definitions
    β”‚   β”‚   β”œβ”€β”€ App.tsx
    β”‚   β”‚   β”œβ”€β”€ App.css
    β”‚   β”‚   β”œβ”€β”€ main.tsx
    β”‚   β”‚   └── index.css
    β”‚   β”‚   └── .env                     # Contains environment variables
    β”‚   β”œβ”€β”€ index.html
    β”‚   β”œβ”€β”€ package.json
    β”‚   β”œβ”€β”€ tsconfig.json
    β”‚   β”œβ”€β”€ tsconfig.app.json
    β”‚
    └── src/main/                        # β˜•  Spring Boot Backend
        β”œβ”€β”€ java/com/tirtha/sfd
        β”‚   β”œβ”€β”€ controller/              # REST API controllers
        β”‚   β”œβ”€β”€ config/                  # Includes configuaration for mail & DB & password
        β”‚   β”œβ”€β”€ service/                 # Business logic & detection engine
        β”‚   β”œβ”€β”€ scheduler/               # Automated failure scan scheduler
        β”‚   β”œβ”€β”€ model/                   # JPA entity classes
        β”‚   β”œβ”€β”€ dto/                     # Object used to transfer data between layers
        β”‚   β”œβ”€β”€ repository/              # Spring Data JPA repositories
        |   β”œβ”€β”€ SilentFailureDetectorApplication.java
        └── resources/
            └── application.properties   # All app config (DB, mail, scheduler)

βš™οΈ How It Works

  • This diagram explains the workflow:

working

Step-by-step:

  1. Your services send workflow step events to the Failure Detector API.
  2. The detection engine checks if each step arrives within its defined time window.
  3. The scheduler runs at regular intervals to catch steps that never arrived at all.
  4. When a failure is detected, it is logged to the database and an email is sent to the admin.
  5. The admin reviews the failure on the dashboard, resolves it, and the user can proceed.

▢️ How to Run

Prerequisites

Before starting, make sure you have the following installed:

  • β˜• Java 17+
  • πŸ”§ Maven
  • πŸ—„οΈ MySQL 8+
  • 🟩 Node.js 18+ (for frontend only)

Step 1 β€” Clone the Repository

git clone https://github.com/your-username/SilentFailureDetector.git
cd SilentFailureDetector/demo

Step 2 β€” Create the Database

CREATE DATABASE failure_detector;

Step 3 β€” Configure the Backend

Edit src/main/resources/application.properties:

# ──────────────────────────────────────
# Database Configuration
# ──────────────────────────────────────
spring.datasource.url=jdbc:mysql://localhost:3306/failure_detector
spring.datasource.username=your_mysql_username
spring.datasource.password=your_mysql_password
spring.jpa.hibernate.ddl-auto=update

# ──────────────────────────────────────
# Email Configuration (Gmail)
# ──────────────────────────────────────
# ⚠️  IMPORTANT: Use a Gmail App Password β€” NOT your normal Gmail password.
#
#  How to generate an App Password:
#    1. Go to your Google Account β†’ Security
#    2. Enable 2-Step Verification (mandatory)
#    3. Go to Security β†’ App Passwords
#    4. Generate a password for "Mail"
#    5. Paste the 16-digit password below
#
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=your_email@gmail.com
spring.mail.password=your_16_digit_app_password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true

# ──────────────────────────────────────
# Scheduler Configuration
# ──────────────────────────────────────
scheduler.check.interval=60000

Step 4 β€” Run the Backend

mvn spring-boot:run

Backend API will be available at http://localhost:8080


Step 5 β€” Run the Frontend

cd sfd-frontend
npm install
npm run dev

Dashboard will be available at http://localhost:5173


πŸ”Œ API Reference

Base URL: http://localhost:8080


πŸ“¨ Events

Method Endpoint Description
POST /api/events Ingest a new workflow step event
GET /api/events?workflowId=1 Fetch all events for a specific workflow

πŸ“Š Failure Dashboard

Method Endpoint Description
GET /api/dashboard/failures Fetch all logged failures
GET /api/dashboard/failures/workflow/{workflowId} Failures filtered by workflow
GET /api/dashboard/failures/type/{type} Failures filtered by type (MISSING / DELAYED)
POST /api/dashboard/failures/resolve/{id} Mark a specific failure as resolved

πŸ” Failure Detection

Method Endpoint Description
POST /api/failures/detect/{workflowId} Manually trigger failure detection for a workflow

πŸ”„ Workflows

Method Endpoint Description
POST /api/workflows Create a new workflow
GET /api/workflows Fetch all workflows

πŸͺœ Workflow Steps

Method Endpoint Description
POST /api/workflow-steps Create a new workflow step
GET /api/workflow-steps?workflowId=1 Fetch all steps for a specific workflow

πŸ“Έ Screenshots

Replace the placeholder paths below with your actual screenshots.

Dashboard Overview Failure Logs
Workflow View Email Alert Add Event
Login Signup

πŸ“§ Email Alert Format

When a failure is detected, the admin receives an email in this format:

Subject: ⚠️ Workflow Failure Detected β€” [Workflow Name]

──────────────────────────────────────
  SILENT FAILURE DETECTOR β€” ALERT
──────────────────────────────────────

Workflow  :  Order Processing Pipeline
Step      :  Payment Confirmation
Status    :  MISSING / DELAYED
Expected  :  Within 30 seconds of "Order Placed"
Detected  :  Step not received within threshold

Please investigate and resolve this issue at the
earliest to avoid further delay for the user.

──────────────────────────────────────

πŸ‘€ Author

Jhaveri Tirtha


πŸ“„ License

This project is unlicensed. All rights reserved by the author.

About

Silent Failure Detection System that monitors workflow events and detects missing or delayed steps in distributed systems.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages