Skip to content

xalk24/SLOGuard

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

SLOGuard πŸ›‘οΈ

A modern, real-time Service Level Objective (SLO) monitoring system with intelligent alerting and beautiful web interface.

SLOGuard Dashboard Go Version React Version License

✨ Features

  • Real-time SLO Monitoring: Track service reliability metrics in real-time
  • Error Budget Tracking: Monitor and manage your error budgets effectively
  • Smart Alerting: Get notified on Slack when SLOs are breached or budgets are exhausted
  • Beautiful Web Interface: Modern React-based dashboard with glassmorphism design
  • Multi-SLI Support: Monitor multiple Service Level Indicators per service
  • PromQL Integration: Use Prometheus queries for flexible metric collection
  • Personal Slack Integration: Each user configures their own Slack webhook
  • Guided Onboarding: Step-by-step setup process for new users

πŸš€ Quick Start

Prerequisites

  • Go 1.19 or higher
  • Node.js 16 or higher
  • npm or yarn
  • Prometheus (for metrics collection)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/slogguard.git
    cd slogguard
  2. Build the frontend

    cd frontend
    npm install
    npm run build
    cd ..
  3. Build and run the backend

    go build -o slogguard cmd/main.go
    ./slogguard
  4. Access the application Open your browser and navigate to http://localhost:8080

First Time Setup

  1. Complete Onboarding: Follow the guided setup to configure your Slack webhook
  2. Add Services: Configure your first service with SLIs and targets
  3. Monitor: Watch your SLO dashboard and receive alerts when needed

πŸ“Š Dashboard Features

Real-time KPI Cards

  • Total Services count with animated counters
  • Healthy vs Alerting services breakdown
  • Average error budget remaining
  • Total SLO breaches

Service Status Overview

  • Live service health indicators
  • Error budget progress bars
  • SLI performance metrics
  • Quick service management

Modern UI/UX

  • White, blue, and black color scheme
  • Glassmorphism effects and smooth animations
  • Responsive design for all devices
  • Dark mode support

πŸ”§ Configuration

Service Configuration

Configure services via the web interface or API:

{
  "service_name": "payment-api",
  "target": 99.9,
  "time_window": "30d",
  "metrics_endpoint": "http://payment-api:8080/metrics",
  "slis": [
    {
      "name": "availability",
      "query": "sum(rate(http_requests_total{status!~\"5..\"}[5m])) / sum(rate(http_requests_total[5m])) * 100",
      "target": 99.9
    },
    {
      "name": "latency_p95",
      "query": "histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m])) * 1000",
      "target": 200
    }
  ]
}

Alert Configuration

Set up Slack alerts through the onboarding process:

{
  "slack": {
    "webhook_url": "https://hooks.slack.com/services/...",
    "channel": "#sloguard-alerts",
    "username": "SLOGuard",
    "icon_emoji": ":warning:",
    "enabled": true
  },
  "base_url": "http://localhost:8080",
  "enabled": true,
  "alert_cooldown": "5m"
}

πŸ“‘ API Endpoints

Service Management

  • GET /configs/{service} - Get service configuration
  • POST /configs - Create/update service configuration
  • GET /status - Get all service SLO statuses
  • GET /status/{service} - Get specific service status

Error Budget

  • GET /budget - Get all error budgets
  • GET /budget/{service} - Get specific service budget
  • GET /breaches/{service} - Get service breach history

Alerting

  • GET /alerts/config - Get alert configuration
  • POST /alerts/config - Update alert configuration
  • POST /alerts/test - Send test alert
  • GET /alerts/stats - Get alerting statistics

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React Frontend β”‚    β”‚   Go Backend    β”‚    β”‚   Prometheus    β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ Dashboard     │◄──►│ β€’ API Server    │◄──►│ β€’ Metrics       β”‚
β”‚ β€’ Service Mgmt  β”‚    β”‚ β€’ SLO Monitor   β”‚    β”‚ β€’ Time Series   β”‚
β”‚ β€’ Alerts Config β”‚    β”‚ β€’ Alert Manager β”‚    β”‚ β€’ PromQL        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚   Slack API     β”‚
                       β”‚                 β”‚
                       β”‚ β€’ Webhooks      β”‚
                       β”‚ β€’ Notifications β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”” Alert Types

SLOGuard sends intelligent alerts for:

  • SLO Breach: When service SLI drops below target
  • Service Recovery: When service returns to healthy state
  • Budget Warning: When error budget drops below 20%
  • Budget Critical: When error budget drops below 5%
  • Budget Exhausted: When error budget is completely consumed

πŸ› οΈ Development

Backend Development

# Run with hot reload
go run cmd/main.go

# Run tests
go test ./...

# Build for production
go build -o slogguard cmd/main.go

Frontend Development

cd frontend

# Start development server
npm start

# Run tests
npm test

# Build for production
npm run build

Project Structure

slogguard/
β”œβ”€β”€ cmd/
β”‚   └── main.go              # Application entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/                 # HTTP handlers and routes
β”‚   β”œβ”€β”€ alert/               # Alert management system
β”‚   β”œβ”€β”€ budget/              # Error budget calculations
β”‚   β”œβ”€β”€ config/              # Configuration management
β”‚   β”œβ”€β”€ monitor/             # SLO monitoring logic
β”‚   β”œβ”€β”€ prometheus/          # Prometheus integration
β”‚   └── types/               # Shared data structures
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ services/        # API service layer
β”‚   β”‚   └── types/           # TypeScript interfaces
β”‚   └── public/              # Static assets
β”œβ”€β”€ go.mod                   # Go dependencies
β”œβ”€β”€ go.sum                   # Go dependency checksums
└── README.md               # This file

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


SLOGuard - Keep your services reliable, one SLO at a time! πŸ›‘οΈβœ¨

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 49.1%
  • TypeScript 45.1%
  • Shell 5.3%
  • CSS 0.5%