How tsyuf/monitor works
Project type and purpose
• This is an open-source, CI/CD-backed monitoring tool. It uses GitHub Actions to schedule and run a Python-based monitoring script, collects ping data, generates visualizations (sparklines), and builds a static HTML dashboard with Quarto. The final site is deployed via GitHub Pages.
Main components
a. CI/CD Layer (GitHub Actions)
• Workflows:
• .github/workflows/monitoring.yml (scheduled runs)
• .github/workflows/run-monitor.yml (manual runs)
• .github/workflows/quarto-render.yml or embedded Quarto render steps
b. Configuration
• Environment variable PING_TARGETS defined in the workflows
• Quarto config files (_quarto.yml, .github/workflows/monitor.qmd, index.qmd)
c. Monitoring Engine
• Python script scripts/monitor.py
• Dependencies: pandas, matplotlib
d. Data Store
• Raw results: data/results.json
• Status summary: docs/status.json
• Sparkline images: docs/sparkline_<target>.png
e. Reporting / Presentation
• Quarto templates and QMD documents (.github/workflows/monitor.qmd, index.qmd)
• Generated HTML: docs/monitoring_report.html, docs/index.html
f. Hosting
• docs/ folder as source for GitHub Pages (deployed from gh-pages or main branch)
• .nojekyll and _config.yml / jekyll-gh-pages.yml for static hosting configuration
Relationships and data flow
1. Trigger (Scheduler or Manual) →
2. GitHub Actions reads PING_TARGETS →
3. scripts/monitor.py pings each host →
4. Writes data/results.json →
5. Generates **docs/sparkline_*.png and updates docs/status.json** →
6. Commits JSON/images →
7. Quarto Render action/process reads QMD + JSON + images →
8. Outputs docs/monitoring_report.html, docs/index.html →
9. Commits and deploys docs/ to GitHub Pages
Architectural patterns and principles
• CI/CD Pipeline: decoupled scheduling, monitoring, and rendering steps
• Separation of Concerns:
• Monitoring logic (Python) vs. Presentation (Quarto)
• Data storage (JSON + PNG) vs. static site generation
• Immutable Outputs: every run produces versioned JSON, images, and HTML committed back
• Infrastructure-as-Code: workflows and configs drive all actions