Inspired by this post: https://antonz.org/is-online/
Prometheus compatible exporter that checks connectivity to given HTTP URI. Default config.yaml checks public internet services, however, you can use it to check API status of your own applications. Don't abuse public services! There is fancy hompage that shows current situation.
- /metrics show Prometheus compatible metrics
- / homepage that shows current situation
Sample config:
endpoints:
- url: https://google.com/generate_204
expect: 204
- url: http://captive.apple.com/hotspot-detect.html
expect: 200
and then use it:
python check.py --config config.yaml --port 9000 --interval 60
Or via environment:
export CONFIG=config.yaml
export PORT=9090
export INTERVAL=30
python check.py
then scrape:
- job_name: connectivity-exporter
static_configs:
- targets: connectivity-exporter.default.svc.cluster.local/metrics:9090
Sample Dokerfile and K8S deployment are provided.
Image: harbor.andreybondarenko.com/library/connectivity-exporter:latest
Fancy hompage that shows current situation.