Ask Your Question

Revision history [back]

To make the Hasura metrics available to Prometheus, follow these steps:

  1. Install Prometheus on your system if it is not already installed.

  2. Install the Prometheus Node Exporter on the Hasura server. This is a Prometheus exporter for machine level metrics.

  3. Ensure that the Hasura server is running with the --metrics flag enabled. This flag exposes the Hasura metrics on port 8080.

  4. Create a Prometheus configuration file (prometheus.yml) and add the Hasura server as a target. This file should contain configuration information about the Prometheus server and the targets to scrape for metrics.

  5. Restart Prometheus so it can reload the new configuration file.

  6. Verify that Prometheus is scraping the Hasura metrics by checking the Prometheus console for the Hasura server metrics.

  7. Visualize the Hasura metrics in Prometheus in order to monitor and analyze performance.

Sample Prometheus configuration file:

global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'hasura'
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets: ['<HASURA_SERVER_IP>:8080']

Note: Replace <HASURA_SERVER_IP> with the IP address of the Hasura server.