The Monitoring Pace Scheduler is an adaptive monitoring solution that dynamically adjusts scrape intervals based on metric patterns. Unlike traditional fixed-interval approaches, it analyzes metric change frequencies to automatically optimize scrape intervals, reducing data collection during stable periods and increasing frequency when metrics show high activity.
Clone the repository:
git clone https://gitlab.com/your-repo/monitoring-pace-scheduler.git
cd monitoring-pace-scheduler
Install dependencies:
pip install -r requirements.txt
Install tcpdump
:
sudo apt install tcpdump
Additional components:
- Prometheus & Node Exporter – Setup Guide
- (Optional) Gatling for load simulation – Simulation Setup
Edit config.yaml
to define scrape logic:
prometheus:
config_file: 'prometheus.yml' # Path to the Prometheus configuration file
reload_url: 'http://0.0.0.0:9091/-/reload' # URL to trigger Prometheus config reload
thresholds:
update_threshold: 0.05 # Minimum change ratio required to update the scrape interval
default_scrape_interval: 15 # Initial interval (in seconds)
max_scrape_interval: 900 # Maximum allowed scrape interval (in seconds)
metrics:
to_monitor:
- '(1 - avg(rate(node_cpu_seconds_total{mode="idle"}[1m])) by (instance)) * 100' # metric to monitor : CPU usage percentage
To run the adaptive monitoring strategy in a production-like environment:
# Run adaptive group
python3 scheduler.py --duration 3600
By default, the scheduler runs for 1 hour (--duration 3600
)
You can remove the --duration
flag to run the monitoring loop continuously.
To assess the impact and efficiency of dynamic scraping:
-
Use Gatling to simulate fluctuating system loads
-
Capture Prometheus network traffic using
tcpdump
-
Compare baseline vs. dynamic strategies in terms of:
- Data volume sent
- Metric behaviour
Full procedure: Benchmark Instructions
Evaluation notebook: src/benchmark/evaluation.ipynb
This project is licensed under the MIT License.