Skip to content

Export Metrics to Prometheus

The console serves its metrics at /api/metrics in Prometheus format, so Prometheus, Grafana Agent or anything else that reads that format can scrape them into an existing monitoring stack. The metrics cover:

  • hosts and VMs (CPU, memory, disk, network),
  • datastores,
  • alarms,
  • tasks,
  • notification deliveries.

A host's disk and network figures are the totals of that host's VMs.

Set it up

  1. Settings → Metrics Export → Generate token (Super Admins only).
  2. Copy the token now. It's stored only as a hash and isn't shown again.
  3. The card shows a ready-made scrape job for your console's address. Add it to prometheus.yml:

    scrape_configs:
      - job_name: mfconsole
        scheme: https
        metrics_path: /api/metrics
        authorization:
          credentials: <scrape token>
        static_configs:
          - targets: ['console.example.com:443']
    
  4. Reload Prometheus and check the target is UP.

The scrape token can read metrics and nothing else. Super Admins can also scrape with their own sign-in or API key, but a dedicated token is the better choice: it can't do anything else if it leaks.

Replace or revoke the token

  • Generate token again replaces the current one. Prometheus gets a 401 until you give it the new token.
  • Revoke removes it. Prometheus gets a 401 until you generate a new one.

The card shows who generated the current token and when. Generating and revoking are recorded in the audit log.

Certificates

If the console uses its own self-signed certificate, add the CA to Prometheus with tls_config: { ca_file: … }. Avoid insecure_skip_verify.

See also