Skip to main content

Grafana integration

CloudQuant Data Liberator exposes a curated, read-only slice of its internal Prometheus stack at a Bearer-authenticated endpoint so you can wire your own Grafana (or any Prometheus-API-compatible client) to the same metrics that power the in-product System Monitoring view. This integration is intended for ops teams, on-call rotations, and infrastructure dashboards that need to live alongside metrics from systems outside CloudQuant.

At a glance

Prerequisites

  • A user with super-admin privileges on your Liberator instance (token management is a super-admin operation).
  • Network reachability from your Grafana host to your Liberator hostname over HTTPS.
  • Grafana 9.x or newer (any version that supports custom HTTP headers on the Prometheus datasource).

Step 1 — Issue a Bearer token

  1. Sign in to the Liberator UI as a super-admin.
  2. Open System Monitoring from the top navigation.
  3. Click the Grafana Integration action in the upper-right of the page.
  4. Click Generate token. The new token is shown exactly once, so copy it immediately.
Tokens follow the format cqm_ + 48 hex characters. Every token issued through this dialog is logged with the issuing user and timestamp; tokens can be listed and revoked from the same dialog.
The full token value is only visible at issue time. Treat it like a password: store it in your secrets manager and never commit it to source control. If a token is lost, revoke it and issue a new one rather than trying to recover it.
Issue one token per logical consumer (e.g. grafana-prod, federated-prometheus-eu) so you can revoke a single consumer’s access without disrupting others.

Step 2 — Configure the Grafana datasource

Through the Grafana UI

  1. Connections → Data sources → Add data source → Prometheus.
  2. Set the fields below:
  3. Under Custom HTTP Headers, click + Add header and set:
    • Header = Authorization
    • Value = Bearer cqm_<your-token>
  4. Click Save & test. You should see “Successfully queried the Prometheus API.”
For reproducible setups, drop this file at /etc/grafana/provisioning/datasources/cloudquant.yaml:
Restart Grafana (or send SIGHUP) to pick up the file. The token lives in secureJsonData, which Grafana persists encrypted at rest.

Step 3 — Run a query

Once the datasource is healthy, you can browse it in Explore or build dashboards against it. A few queries to verify end-to-end connectivity:

What’s exposed

The Bearer endpoint forwards to the same Prometheus server that powers the in-product System Monitoring view, so anything you see there is also queryable here. Notable metric families: For a complete metric inventory in your environment, query /api/v1/label/__name__/values once you’ve connected.

Rotating a token

  1. Open the Grafana Integration dialog as in Step 1.
  2. Issue a new token for the same logical consumer.
  3. Update the new token in Grafana (UI: edit the datasource → swap the Authorization header value; provisioning: replace httpHeaderValue1 and restart).
  4. Wait until your Grafana datasource health check passes with the new token.
  5. Revoke the old token from the same dialog.
This zero-downtime pattern is the same as the AWS access-key rotation workflow.

Limitations

  • Read-only. Prometheus admin endpoints (/api/v1/admin/tsdb/*) and the remote-write receiver are not exposed. Even tokened callers cannot mutate the TSDB through this endpoint.
  • One Prometheus. The endpoint serves the Liberator cluster’s primary Prometheus only. Federated views across multiple Liberator clusters require Prometheus-side federation on the consumer side; use /metrics-api-bearer/federate with appropriate match[] parameters.
  • CORS. Browser-side direct calls are not supported (the gateway only allows server-side calls). Grafana proxies through its backend, so this restriction does not affect dashboard use.

Troubleshooting