{% extends "base_project.html" %} {% load humanize static hc_extras %} {% block title %}Prometheus Integration for {{ site_name }}{% endblock %} {% block content %}

Prometheus

{{ site_name }} provides a Prometheus-compatible metrics endpoint for each project. The endpoints are secured using each project's read-only API key. If your team uses Prometheus, you can configure it to scrape {{ site_name }} and have up-to-date check and tag status values available in Prometheus.

Setup Guide

Look up your project's read-only API key in Project Settings › API Access.

If you have not generated API keys before, you will need to do that first.

Click create integration button

Edit Prometheus configuration and add a new section in the scrape_configs section.

- job_name: 'healthchecks-{{ project|slugify }}'
  scheme: {{ site_scheme }}
  metrics_path: /projects/{{ project.code }}/metrics/YOUR-READ-ONLY-API-KEY
  static_configs:
  - targets: ['{% site_hostname %}']

Note for Grafana Cloud users: 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, {% site_name %} provides an alternate metrics endpoint which requires "Bearer" authentication. Use the following settings with Grafana Cloud:

  • Scrape Job URL: {{ project.auth_metrics_url }}
  • Authentication type: Bearer
  • Bearer token: the read-only API key

Reload Prometheus' configuration. You should now start seeing {{ site_name }} data appear in Prometheus.

{% endblock %}