Prom-url-checker, a url checker with prometheus metrics output
Project description
prometheus-url-checker
This little script periodically checks all configured urls with a HTTP HEAD request. The requests http code will be returned as prometheus compatible metric (gauge).
Links
Install
The packages uses the flit packager and requires python 3.6.
pip3 install flitflit install
Usage
The application is very simple to configure. Simply set the URLS environment variable and start the server with prom-url-checker. You can see the metrics opening http://127.0.0.1:9999/metrics. To integrate this into your prometheus environment, simply add a new prometheus endpoint.
A very simple cli allows the configuration of all necessary parameters.
prom-url-checkerstarts the metrics server on127.0.0.1:9999using theURLSenvironmental variableprom-url-checker --helpshow's available cli options:
Options:
--host=STR Host ip to serve on. (default: 127.0.0.1)
--port=STR Port to use (default: 9999)
-s, --sleeptime=INT Sleeptime during checks (default: 5)
--urls=STR Comma seperated list of urls to check, e.g. --urls https://test.domain.de,http://domain.de. If unset, the environment variable URLS will be used instead.
-d, --debug Enable debugging mode
Other actions:
-h, --help Show the help
Metrics
# HELP request_in_progress Number of requests in progress
# TYPE request_in_progress gauge
request_in_progress{app="url_health_checker",host="f8cad31124a6",route="/"} 0
# HELP url_health Health status of a url.
# TYPE url_health gauge
url_health{app="url_health_checker",host="f8cad31124a6",url="https://google.com"} 301
url_health{app="url_health_checker",host="f8cad31124a6",url="https://github.com"} 200
# HELP url_health_request_processing_seconds Time spent processing request
# TYPE url_health_request_processing_seconds summary
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.5"} 0.17756042900145985
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.9"} 0.2960943900034181
url_health_request_processing_seconds{app="url_health_checker",host="f8cad31124a6",quantile="0.99"} 0.2960943900034181
url_health_request_processing_seconds_count{app="url_health_checker",host="f8cad31124a6"} 14
url_health_request_processing_seconds_sum{app="url_health_checker",host="f8cad31124a6"} 3.8046043350186665
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prom-url-checker-0.0.4.tar.gz.
File metadata
- Download URL: prom-url-checker-0.0.4.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c72af73219944721e1b70c34f22d1a255cc3d65bb893b0b71a0ba3c03d38d75f
|
|
| MD5 |
642ffe9828f129a0409ebcee59564537
|
|
| BLAKE2b-256 |
bb20a721dcea19bd927d33483b31bb1c1118a22812e8116ae03bfeafb8a70e9d
|
File details
Details for the file prom_url_checker-0.0.4-py3-none-any.whl.
File metadata
- Download URL: prom_url_checker-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
414dfb7eb1b18ba816016c6c0bc5c3233d47ba014512de19a1e05d211db416e9
|
|
| MD5 |
017bd969531b1cbb547de60e122aa298
|
|
| BLAKE2b-256 |
cf94a023c49bf0aa638d72a8ff7743058300556a2e54c1c2f588e59032f47b3f
|