Skip to content

Latest commit

ย 

History

89 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ฆ DevOps Monitoring in a Box

banner

Docker Ready Live Demo License

๐Ÿš€ Overview

This project provides a complete, production-grade monitoring stack for DevOps engineers, SREs, and beginners. With just one command, you get:

๐ŸŽฏ Demo Preview Available: Check out the live demo at devops-monitoring-in-a-box.vercel.app
Login: demo@example.com / demo123 (Demo credentials only - configure your own for production)

  • ๐Ÿ“ˆ Prometheus โ†’ High-performance metrics collection and alerting engine
  • ๐Ÿ“Š Grafana โ†’ Beautiful dashboards with pre-provisioned datasources and views
  • ๐Ÿ“œ Loki โ†’ Centralized log aggregation and stream querying
  • ๐Ÿšจ Alertmanager โ†’ Multi-channel notification router (Slack, Teams, Discord, Email, Webhooks)
  • ๐Ÿ–ฅ๏ธ Node Exporter โ†’ Real-time host and system metrics (CPU, RAM, Disk, Load, Network)
  • ๐Ÿณ cAdvisor โ†’ Container CPU, memory, and lifecycle resource monitoring
  • ๐Ÿ›ฐ๏ธ Blackbox Exporter โ†’ Synthetic HTTP/HTTPS, TCP, DNS, and ICMP uptime probing
  • ๐Ÿ”’ SSL/TLS Certificate Tracker โ†’ Domain certificate expiration, validity days, and SAN inspector
  • โฑ๏ธ SLI/SLA Availability Engine โ†’ 99.9% / 99.99% uptime heatmaps and MTTR tracking
  • ๐Ÿ”” Multi-Channel Notification Service โ†’ Automated webhook dispatching and masking
  • ๐ŸŽจ Radix-Sera Unified UI โ†’ Modern Next.js 16 web interface styled with shadcn UI and Hugeicons

๐Ÿ‘‰ Perfect for learning, testing, local homelabs, or full production deployments.

๐Ÿš€ What Sets Us Apart: While most monitoring projects stop at Prometheus + Grafana, we provide a modern, responsive web interface that unifies all your monitoring tools into one seamless dashboard experience!


โœจ New & Highlighted Features

๐ŸŽจ 1. Modern Radix-Sera Design System

  • shadcn UI with Sera Preset: Clean, high-contrast aesthetics with seamless Dark/Light mode switching.
  • Hugeicons Integration: Crisp, accessible stroke icons replacing bulky legacy icon sets.
  • Micro-animations: Smooth Framer Motion transitions across dashboard widgets, metrics cards, and log inspectors.

๐Ÿ”’ 2. SSL/TLS Certificate Expiration & Health Tracker

  • Real-time Probing: Live SSL/TLS inspection via /api/ssl for any public or internal domain.
  • Early Expiry Warnings: Color-coded badges for Valid (>30d), Warning (14-30d), and Critical/Expired (<14d).
  • Certificate Metadata: Displays Certificate Authority (Issuer CA), Subject, Validity ranges, Serial Numbers, and Subject Alternative Names (SANs).

โฑ๏ธ 3. SLI / SLA Availability & Outage Tracker

  • Uptime Heatmaps: Interactive 30-day timeline bars showing daily uptime percentages.
  • Key Reliability Metrics: Mean Time to Recovery (MTTR), 24h/7d/30d availability SLAs, and active outage counters.
  • Synthetics Integration: Automatically correlates with Prometheus Blackbox Exporter probe results.

๐Ÿ”• 4. Alertmanager Quick Silence Management

  • One-Click Silences: Create 1h, 2h, 4h, or 24h silences directly from the alert cards.
  • Inhibitor Rules: Pre-configured alert inhibition prevents alert fatigue when root hosts go down.

๐Ÿ›ก๏ธ 5. Zero-Vulnerability Hardened Docker Container

  • Docker Scout Verified: Clean scan with 0 Critical CVEs.
  • Process Supervision (tini): Proper PID 1 signal forwarding (SIGTERM/SIGINT) and zombie reaping.
  • Least-Privilege Execution: Runs under a dedicated non-root nextjs user with secured .next/cache permissions.

๐Ÿ–ผ๏ธ Visual Showcase


Main Dashboard
Unified monitoring dashboard with system overview

Metrics & Analytics
Real-time metrics visualization and PromQL analysis

Log Management
Centralized Loki log viewing and search

Alert Management
Comprehensive alert routing and 1-click silencing

Services & SLA & SSL Tracker
Health checks, 30-day uptime SLA, and certificate monitoring
Settings & Configuration


Comprehensive notification channels and multi-tenant settings

๐Ÿš€ Usage & Deployment

Choose your preferred deployment method based on your needs:

๐Ÿณ Docker Deployment (Recommended)

Option 1: Quick Start with Docker Compose (Full Stack)

# Clone the repository
git clone https://github.com/NotHarshhaa/devops-monitoring-in-a-box.git
cd devops-monitoring-in-a-box

# Generate secure secrets (.env and Alertmanager token)
./scripts/setup-env.sh

# Start the complete monitoring stack
docker compose up -d

Option 2: Native PowerShell (Windows)

.\scripts\devops-monitor.ps1 init-env    # generate .env with strong secrets
.\scripts\devops-monitor.ps1 start       # start the stack
.\scripts\devops-monitor.ps1 status      # containers + dashboard health
.\scripts\devops-monitor.ps1 health      # probe every published endpoint
.\scripts\devops-monitor.ps1 logs -Service prometheus
.\scripts\devops-monitor.ps1 validate    # promtool + amtool + compose config
.\scripts\devops-monitor.ps1 verify      # lint, type-check, tests, build
.\scripts\devops-monitor.ps1 clean       # remove containers and volumes

Option 3: Pre-built Docker Image

docker pull harshhaareddy/devops-monitoring-box:latest
docker run -d -p 4000:3000 --name devops-monitor harshhaareddy/devops-monitoring-box:latest

๐ŸŒ Cloud Deployment

Vercel (Frontend Only)

Vercel

# Deploy the UI to Vercel
cd ui-next
npm install
vercel --prod

Netlify (Frontend Only)

Netlify

# Build and deploy to Netlify
cd ui-next
npm install
npm run build

Railway (Full Stack)

Railway

# Deploy full stack to Railway
railway login
railway init
railway up

๐ŸŽฏ Access Points

Once deployed, access your monitoring tools:

Service Port / URL Credentials Description
๐ŸŽจ DevOps Monitor UI http://localhost:4000 demo@example.com / demo123 Unified observability web application
โค๏ธ Health API http://localhost:4000/api/health - Stack health, used by the container healthcheck
๐Ÿ“Š Grafana http://localhost:3000 admin / admin Visualization dashboards with pre-provisioned datasources
๐Ÿ“ˆ Prometheus http://localhost:9090 - Metrics collection & PromQL engine
๐Ÿ“œ Loki http://localhost:3100 - Log aggregation and query service
๐Ÿšจ Alertmanager http://localhost:9093 - Alert routing & silencing
๐Ÿ›ฐ๏ธ Blackbox Exporter http://localhost:9115 - HTTP/TCP uptime probing
๐Ÿ–ฅ๏ธ Node Exporter http://localhost:9100/metrics - Host kernel & hardware metrics
๐Ÿณ cAdvisor http://localhost:8080/metrics - Container performance metrics

๐Ÿ”ง Management & CLI Helpers

Bash Command (./devops-monitor.sh) PowerShell (.\scripts\devops-monitor.ps1) Purpose
./devops-monitor.sh start .\scripts\devops-monitor.ps1 start Start all stack containers
./devops-monitor.sh status .\scripts\devops-monitor.ps1 status Check service health & running state
./devops-monitor.sh health .\scripts\devops-monitor.ps1 health Probe all endpoints for 200 OK
./devops-monitor.sh logs .\scripts\devops-monitor.ps1 logs View unified logs across services
./devops-monitor.sh stop .\scripts\devops-monitor.ps1 stop Gracefully shut down all containers
./devops-monitor.sh clean .\scripts\devops-monitor.ps1 clean Remove containers and data volumes

๐Ÿ“‚ Project Structure

๐Ÿ—๏ธ Core Components

  • prometheus/ - Metrics collection, alert rules, and targets/ probe lists
  • grafana/ - Dashboard and visualization provisioning
  • loki/ - Log aggregation and collection configs
  • alertmanager/ - Alert routing, notification channels, and silencing
  • ui-next/ - Modern Next.js web application
  • docs/ - Comprehensive documentation
  • exporters/ - Exporter configuration (Blackbox uptime probing)

๐ŸŽฏ Key Files

  • devops-monitor.sh - Main management script (Linux/macOS wrapper)
  • scripts/devops-monitor.ps1 - Native Windows PowerShell management script
  • env.example - Environment variables template
  • site-config.json - Site configuration (SEO, branding)
  • config.json - Monitoring configuration
  • docker-compose.yml - Production stack configuration
  • prometheus/targets/*.yml - Uptime probe targets, hot-reloaded without restart

For a complete breakdown of all directories and files, see Project Structure Guide.


๐Ÿ“Š Feature Breakdown

๐Ÿ”ง Core Monitoring Stack

  • ๐Ÿ“ˆ Metrics Collection: Prometheus with Node Exporter for system metrics
  • ๐Ÿ–ผ๏ธ Dashboards: Pre-configured Grafana dashboards with beautiful visualizations
  • ๐Ÿ“œ Log Aggregation: Loki + Promtail for centralized log management
  • ๐Ÿšจ Alert Management: Alertmanager with multi-channel notifications
  • ๐Ÿ“Š Service Health: Real-time service status monitoring

๐ŸŽจ Modern Web Interface

  • ๐Ÿ–ฅ๏ธ Unified Dashboard: Single-page application for all monitoring needs
  • ๐Ÿ“ฑ Responsive Design: Works perfectly on desktop, tablet, and mobile
  • ๐ŸŒ™ Dark/Light Theme: Automatic theme switching with user preference
  • โšก Real-time Updates: Live data refresh without page reloads
  • ๐ŸŽฏ Intuitive Navigation: Easy-to-use sidebar navigation

๐Ÿ” Authentication & Security

  • ๐Ÿ‘ค User Authentication: Secure login system with session management
  • ๐Ÿข Multi-tenant Support: Role-based access control (Admin, Editor, Viewer)
  • ๐Ÿ”’ Secure API: Protected endpoints with authentication middleware
  • ๐Ÿ›ก๏ธ Input Validation: Comprehensive data validation and sanitization

๐Ÿ”” Notification System

  • ๐Ÿ“ง Email Alerts: SMTP-based email notifications
  • ๐Ÿ’ฌ Slack Integration: Direct Slack channel notifications
  • ๐ŸŽฏ Microsoft Teams: Teams webhook integration
  • ๐ŸŽฎ Discord Support: Discord webhook notifications
  • ๐Ÿ”— Custom Webhooks: Generic webhook support for any service

๐Ÿ›ฐ๏ธ Synthetic Uptime & Dynamic Probing

The stack ships a Blackbox Exporter so you can watch any HTTP, HTTPS or TCP endpoint:

Add targets to prometheus/targets/http-probes.yml without restarting the stack:

# prometheus/targets/http-probes.yml
- targets:
    - https://api.yourcompany.com/health
    - https://yourcompany.com
  labels:
    module: https_2xx     # probe module from exporters/blackbox/config.yml
    env: production       # any labels you add appear on the probe_* series
    team: platform

On Windows, the management script can add probes for you:

.\scripts\devops-monitor.ps1 probe -Url https://my-app.example.com/health

Prometheus automatically hot-reloads probe target files every 30 seconds.


๐Ÿ”€ How the Dashboard Reaches the Backends

The browser never calls Prometheus, Loki or Alertmanager directly. It calls the dashboard, which forwards the request server-side:

browser โ”€โ”€โ–ถ /api/proxy/prometheus/api/v1/query โ”€โ”€โ–ถ http://prometheus:9090/api/v1/query

This matters for three reasons:

  • It works in Docker. Container hostnames such as prometheus:9090 cannot be resolved by a browser, so direct calls fail in any containerised deployment.
  • No CORS setup. Requests are same-origin.
  • The backends can stay private. You can remove the published 9090, 3100 and 9093 ports entirely and the dashboard keeps working.

Every proxied request requires a signed-in user, and each upstream path is matched against an explicit allowlist (ui-next/lib/server/upstream.ts). Administrative endpoints โ€” Prometheus' admin/tsdb/delete_series, Loki's push โ€” are not reachable through the proxy.


๐Ÿ“ˆ What You'll Get

Prometheus

  • Scrapes metrics from Node Exporter and cAdvisor every 15 seconds
  • Stores time-series data for historical analysis
  • Built-in query language (PromQL) for data exploration

Grafana

  • Pre-configured Prometheus and Loki data sources
  • Node Exporter and container dashboards showing real-time metrics
  • Custom alerts and dashboard templating

Loki

  • Collects logs from containers and system services
  • Efficient log storage and querying
  • Log-to-metric correlations in Grafana

Alertmanager

  • Production-ready alert rules for system, disk, and container alerts
  • Slack/Email/Discord/Teams webhook routing
  • Integrated silence management

Node Exporter & cAdvisor

  • Host CPU, memory, disk, network metrics
  • Container memory working sets, CPU throttling, and OOM event tracking

๐Ÿ“š Documentation

๐Ÿ“– Complete Documentation Hub - Comprehensive guides and setup instructions

Key Documentation Links:


๐Ÿ”’ Security Notes

  • NEXTAUTH_SECRET and ALERT_WEBHOOK_TOKEN are required โ€” Compose fails rather than accepting a shared/default signing key or an unauthenticated Alertmanager webhook. Generate both and the matching alertmanager/webhook_token file with ./scripts/setup-env.sh or .\scripts\devops-monitor.ps1 init-env.
  • Change default Grafana credentials before exposing the stack in production.
  • Prometheus admin API (--web.enable-admin-api) is disabled by default.
  • /api/notifications never returns plain SMTP passwords or channel webhook URLs in client payloads; they are masked, and saving preserves stored secrets.
  • Published ports 9090, 3100, 9093, and 9115 are optional for convenience. The dashboard proxies internal traffic via Docker networks, so external ports can be removed in hardened environments.

๐Ÿค Contributing

  1. Fork the repository (git clone https://github.com/NotHarshhaa/devops-monitoring-in-a-box.git)
  2. Create a feature branch (git checkout -b feature/awesome-feature)
  3. Commit your changes (git commit -m 'Add awesome feature')
  4. Push to the branch (git push origin feature/awesome-feature)
  5. Open a Pull Request

๐Ÿ“ License

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


๐Ÿ™ Acknowledgments


๐Ÿ› ๏ธ Author & Community

Built with passion and purpose by Harshhaa.
Your ideas, feedback, and contributions are what make this project better.

Letโ€™s shape the future of DevOps monitoring together! ๐Ÿš€

Connect & Collaborate:


โญ How You Can Support

If you found this project useful:

  • โญ Star the repository to show your support
  • ๐Ÿ“ข Share it with your friends and colleagues
  • ๐Ÿ“ Open issues or submit pull requests to help improve it

๐Ÿ“ข Stay Connected

Follow Me

Join the community, share your experience, and help us grow!

About

This project provides a ready-to-use advanced monitoring platform for DevOps engineers and beginners. With just one command, you get Prometheus, Grafana, Loki, Alertmanager, Node Exporter

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages