Production-grade outage schedule monitor with Redis-backed pipeline
Explore the docs »
Report Bug
·
Request Feature
- About The Project
- Built With
- Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
monitor-go scrapes the Красноярск city outage schedule from Gorod.htm, parses the data, detects changes, and publishes new outage records via Redis Pub/Sub. It replaces a legacy Python bot with a modular, testable Go service.
Key features:
- Scheduler — periodic ticker-based orchestrator that runs the full pipeline on a configurable interval
- Scraper — HTTP client with ETag-based change detection, charset-aware HTML parsing (Windows-1251 via goquery)
- Parser — extracts organization info, Russian addresses, outage details, and Russian date strings; includes an embedded SQLite street name database for normalization
- Storage — Redis-backed diff engine: computes MD5 hashes of parsed records, commits only new/changed entries with TTL
- Publisher — serializes outages as JSON and publishes to a Redis channel (
{prefix}:outages) - Metrics — Prometheus counters and histograms for every operation across all modules
- Docker — multi-stage build with docker-compose (includes Redis)
- Go 1.25+ (for source builds)
go version
- Docker & Docker Compose (for the compose workflow)
docker --version && docker compose version
git clone https://github.com/005-bot/monitor-go.git
cd monitor-go
docker compose upThe service starts on http://localhost:3000. No external Redis needed — the compose file includes one with a health check.
Configuration is loaded via environment variables using the __ separator (e.g. REDIS__URL).
| Variable | Default | Description |
|---|---|---|
REDIS__URL |
redis://localhost:6379 |
Redis connection URL |
SCRAPER__URL |
http://93.92.65.26/aspx/Gorod.htm |
HTML table source URL |
SCRAPER__INTERVAL |
300 |
Polling interval in seconds |
STORAGE__TTL_DAYS |
5 |
Record retention in days |
STORAGE__PREFIX |
bot-005 |
Redis key prefix |
PUBLISHER__PREFIX |
bot-005 |
Redis channel prefix |
PARSER__ADDRESS_DB_PATH |
(embedded streets.db) |
Custom SQLite database path |
go run .Or build and run the binary:
go build -o monitor .
./monitorQuality checks:
make fmt
make lint
make test- Prometheus alerts based on scheduler error metrics
- Graceful shutdown improvements and circuit breaker on scrape failures
- Structured logging with request IDs across the pipeline
See the open issues for a full list of proposed features and known issues.
Contributions make the open-source community great. If you have a suggestion, please fork the repo and create a pull request. You can also open an issue with the "enhancement" tag.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the Apache 2.0 License. See LICENSE for more information.
Maintainer: @capcom6
Project Link: https://github.com/005-bot/monitor-go