MHD - Healthchecks supports exporting metrics and check statuses to Prometheus, for use with Grafana.
Create a read-only API key in Project Settings › API Access.
Make sure to use a read-only API key. Prometheus does not need read-write API access.
Add the following scrape configuration to Prometheus:
- job_name: "healthchecks"
scrape_interval: 60s
scheme: https
metrics_path: /projects/{your-project-uuid}/metrics/{your-readonly-api-key}
static_configs:
- targets: ["healthchecks.quarkdose.de"]
The "{your-project-uuid}" is the UUID you see in your browser's address bar when viewing a list of checks for a particular project.
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
– the 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 the check's code)For every check, indicates whether the check is currently running (1 for yes, 0 for no).
Labels:
name
– the 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 the 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 MHD - Healthchecks. Construct the URLs like so:
https://healthchecks.quarkdose.de/cloaked/{unique_key}/
Grafana Cloud requires the metrics endpoints to be authenticated using either HTTP "Basic" or "Bearer" authentication scheme. It refuses to scrape public endpoints. To fulfil this requirement, MHD - Healthchecks provides an alternate metrics endpoint which requires "Bearer" authentication. Use the following settings with Grafana Cloud:
https://healthchecks.quarkdose.de/projects/{your-project-uuid}/metrics/