Skip to main content

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 flit
  • flit 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-checker starts the metrics server on 127.0.0.1:9999 using the URLS environmental variable
  • prom-url-checker --help show'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

Metadata

Release files for prom-url-checker 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prom-url-checker 0.0.4
File Size Uploaded Provenance Actions
prom-url-checker-0.0.4.tar.gz 8.0 kB Without provenance Details for prom-url-checker-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prom-url-checker 0.0.4
File Interpreter ABI Platform Actions
prom_url_checker-0.0.4-py3-none-any.whl Python 3 none any Details for prom_url_checker-0.0.4-py3-none-any.whl

Total release size: 22.1 kB

Release files / prom-url-checker-0.0.4.tar.gz

Download URL prom-url-checker-0.0.4.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c72af73219944721e1b70c34f22d1a255cc3d65bb893b0b71a0ba3c03d38d75f
BLAKE2b-256 checksum
How to use checksums
bb20a721dcea19bd927d33483b31bb1c1118a22812e8116ae03bfeafb8a70e9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / prom_url_checker-0.0.4-py3-none-any.whl

Download URL prom_url_checker-0.0.4-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
414dfb7eb1b18ba816016c6c0bc5c3233d47ba014512de19a1e05d211db416e9
BLAKE2b-256 checksum
How to use checksums
cf94a023c49bf0aa638d72a8ff7743058300556a2e54c1c2f588e59032f47b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Security for prom-url-checker 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page