From 0b5fa40f68825d01af64f86235b952b0ebc4af23 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 22 Jun 2020 15:53:22 -0700 Subject: [PATCH] Create configuring_prometheus.md Add documentation on how to export metrics to prometheus. --- templates/docs/configuring_prometheus.md | 26 ++++++++++++++++++++++++ templates/front/base_docs.html | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 templates/docs/configuring_prometheus.md diff --git a/templates/docs/configuring_prometheus.md b/templates/docs/configuring_prometheus.md new file mode 100644 index 00000000..d28aa46f --- /dev/null +++ b/templates/docs/configuring_prometheus.md @@ -0,0 +1,26 @@ +# Configuring Prometheus + +Healthchecks.io supports exporting metrics and check statuses to [Prometheus](https://prometheus.io/), for use with [Grafana](https://grafana.com/). + +You can generate the metrics export endpoint by going to your project settings (last tab up top) and clicking "Create API Keys". You will then see the link to the prometheus endpoint, which looks like this: + +``` +https://healthchecks.io/projects/45sd78-eeee-dddd-8888-b25a9887ecfd/metrics/NXyGzks4s8xcF1J-wzoaioyoqXIANGD0 +``` + +## Update the prometheus.yml + +You can take that link and add it to the prometheus config: + +```yaml + - job_name: "healthchecks" + scrape_interval: 60s + scheme: https + metrics_path: /projects/45sd78-eeee-dddd-8888-b25a9887ecfd/metrics/NXyGzks4s8xcF1J-wzoaioyoqXIANGD0 + static_configs: + - targets: ["healthchecks.io"] +``` + +Notice how we split up the URL and paste in the scheme, domain, and path separately. + +Reload promethus and your changes should be live, coming in under the `hc_` prefix. diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index 5d7a1481..7c8d6adf 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -32,6 +32,7 @@ {% include "front/docs_nav_item.html" with slug="measuring_script_run_time" title="Measuring script run time" %} {% include "front/docs_nav_item.html" with slug="attaching_logs" title="Attaching logs" %} {% include "front/docs_nav_item.html" with slug="cloning_checks" title="Cloning Checks" %} + {% include "front/docs_nav_item.html" with slug="configuring_prometheus" title="Configuring Prometheus" %} {% include "front/docs_nav_item.html" with slug="api" title="Management API" %} @@ -47,4 +48,4 @@ {% endblock %} -{% endblock %} \ No newline at end of file +{% endblock %}