{% extends "base_project.html" %} {% load humanize static hc_extras %} {% block title %}Prometheus Integration for {{ site_name }}{% endblock %} {% block content %}
{{ 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.
Create a read-only API key in Project Settings › API Access.
Note: make sure to use a read-only API key. Prometheus does not need read-write API access.
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:
{{ project.auth_metrics_url }}Reload Prometheus' configuration. You should now start seeing {{ site_name }} data appear in Prometheus.