Healthchecks supports exporting metrics and check statuses to Prometheus, for use with Grafana.
You can generate the metrics export endpoint by going to your project settings and creating a read-only API key. You will then see the link to the Prometheus endpoint:
You can copy the Prometheus endpoint URL and add it to the Prometheus configuration:
- job_name: "healthchecks"
scrape_interval: 60s
scheme: https
metrics_path: /projects/{your-project-uuid}/metrics/{your-readonly-api-key}
static_configs:
- targets: ["healthchecks.niyawe.de"]
Notice how we split up the URL and paste in the scheme, domain, and path separately.
Reload Prometheus, and your changes should be live, coming in under the hc_
prefix.
The Prometheus metrics endpoint exports the following metrics:
For every check, indicates whether the check is currently up (1 for yes, 0 for no).
Labels:
name
– name of the checktags
– check's tags as a text string, multiple tags are delimited with spacesunique_key
– a stable, unique identifier of the check (derived from check's code)For every check, indicates whether the check is currently running (1 for yes, 0 for no).
Labels:
name
– name of the checktags
– check's tags as a text string, multiple tags are delimited with spacesunique_key
– a stable, unique identifier of the check (derived from check's code)For every tag, indicates whether all checks with this tag are up (1 for yes, 0 for no).
Labels:
tag
– name of the tagYou can use the unique_key
labels to construct URLs to check's
details pages in Healthchecks. Construct the URLs like so:
https://healthchecks.niyawe.de/cloaked/{unique_key}/