Skip to content

Feat(Server): Add optional Grafana monitoring dashboard to server installer#124

Open
Isusami wants to merge 2 commits intomasterking32:mainfrom
Isusami:feature/grafana-monitoring
Open

Feat(Server): Add optional Grafana monitoring dashboard to server installer#124
Isusami wants to merge 2 commits intomasterking32:mainfrom
Isusami:feature/grafana-monitoring

Conversation

@Isusami
Copy link
Copy Markdown

@Isusami Isusami commented Apr 11, 2026

Summary

Adds an optional Prometheus + Grafana monitoring stack that can be installed alongside MasterDnsVPN during server setup. When the user opts in at the start of installation, the system automatically provisions:

  • A Python Prometheus exporter that collects service status, active sessions, and traffic metrics via systemctl, iptables, and journalctl
  • Dockerized Prometheus and Grafana with a pre-built dashboard (server status, sessions, throughput, traffic panels)
  • Systemd service for the exporter with automatic restart
  • Firewall rules for Grafana (3000) and Prometheus (9090)

The monitoring module is fully self-contained under monitoring/ and can also be installed standalone, ensuring it does not interfere with future project updates.

Changes

  • monitoring/ — New self-contained module: exporter script, Docker Compose setup, Prometheus config, Grafana provisioning (datasource + dashboard), install script, and README
  • server_linux_install.sh — Added early opt-in prompt for monitoring, auto-download of the monitoring module via git clone, sourcing of monitoring/install.sh, combined final summary with Grafana access details, and set -e safety fixes

Test plan

  • Fresh install with monitoring = yes: all components deploy, summary shows Grafana URL/credentials
  • Fresh install with monitoring = no: no monitoring artifacts created, standard summary only
  • Grafana health endpoint returns OK on port 3000
  • Exporter /metrics returns all expected gauges and counters
  • Prometheus target health is up with zero scrape errors
  • Non-interactive (no TTY) install gracefully skips monitoring prompt

Isusami added 2 commits April 11, 2026 14:32
Adds an optional monitoring stack (Prometheus + Grafana) under
monitoring/ that can run standalone or be sourced by the main
installer. Includes:

- Python Prometheus exporter for service status, sessions, and
  traffic metrics via systemctl, iptables, and journalctl
- Docker Compose setup for Prometheus and Grafana containers
- Pre-built Grafana dashboard with server status, active sessions,
  throughput, and traffic panels
- Standalone install script with auto-detection of package manager,
  firewall, Docker, and TTY availability
- README with setup, metrics reference, and troubleshooting
Adds a monitoring opt-in prompt early in the installation flow.
When accepted, the installer downloads the monitoring module via
git clone and sources monitoring/install.sh to set up the full
Prometheus + Grafana stack automatically.

- Prompt uses TTY detection to skip gracefully in non-interactive
  environments
- Downloads monitoring module from the repo branch, bypassing
  CDN caching
- Combined final summary shows MasterDnsVPN service commands,
  Grafana access details, and monitoring management commands
- Fix backup_file_once() to be safe under set -euo pipefail
@Isusami Isusami force-pushed the feature/grafana-monitoring branch from eb8a369 to bd431b7 Compare April 11, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant