Prerequisites
- Mokonyx Insight installed and enabled on your site.
- A reachable, read-only Prometheus query endpoint (for example
https://metrics.example.com). The plugin calls only/api/v1/queryand/api/v1/query_range. - A query-only Bearer token for that endpoint, if it is token-protected (recommended for any public endpoint).
1. Enable the provider
Go to System → Manage → Plugins, search for “Mokonyx Insight - Prometheus”, and enable it.
2. Configure the connection
Open the plugin and set:
- Prometheus URL - the base URL of your endpoint, e.g.
https://metrics.example.com. - Bearer token - a query-only token sent as an
Authorization: Bearerheader. Leave blank only if your endpoint is unauthenticated. - HTTP timeout - request timeout in seconds (default 5).
- Verify TLS - leave on for any public endpoint.
- Cache TTL - seconds to cache query results so dashboard auto-refresh does not hammer Prometheus (default 15; 0 disables).
3. Obtaining a Bearer token
A Bearer token authenticates your read-only queries. Request a query-only token from whoever administers your Prometheus endpoint - never use a token that can write or administer Prometheus. Paste it into the Bearer token field and save. If the endpoint returns 401 Unauthorized, the token is missing or incorrect; a healthy read-only endpoint returns 200 for a valid token.
4. Choose your metrics
In the plugin’s Metrics tab, curate the catalog exposed to dashboards. Each row maps a short name to a PromQL expression:
- Name - a short key, exposed as
infra.<name>(e.g.cpu→infra.cpu). - Label - the display label shown on widgets.
- Type - Scalar for a single current value, Time series for a chart over time.
- PromQL - the expression, e.g.
100 - (avg by(instance)(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100). - Step - optional range resolution; blank auto-picks ~300 points.
A reserved infra.promql metric is always available for charting an arbitrary PromQL expression passed per widget.
5. Add metrics to a dashboard
Create or edit a dashboard, add a widget, and pick one of your infra.* metrics as its data source - a counter/gauge for scalar metrics or a line chart for time series. Save, and the metric renders live from Prometheus.
Troubleshooting
- No
infra.*metrics in the picker - confirm the plugin is enabled and a Prometheus URL is set. - Empty widget /
401- the Bearer token is missing or wrong, or the endpoint requires one. - Empty widget / timeout - the endpoint is unreachable from your server, or the PromQL returned no data. Verify the expression in Prometheus directly.