Integrations

Grafana — Custom Dashboards from MonPG Metrics

Pull MonPG's time-series API into Grafana via the Infinity datasource.

MonPG's built-in dashboards cover the obvious cases. Where Grafana wins is the team-specific layout: an oncall view that shows just what your oncall person needs, an exec summary that hides everything except the top-line numbers, a tuning view focused on one cluster. The MonPG API exposes the same time-series the UI reads from, so anything you see in MonPG you can re-render in Grafana.

Install the Infinity datasource

The Infinity datasource reads JSON, CSV, GraphQL — anything you can hit with HTTP. Install it through Grafana's plugin catalog. We use Infinity rather than building a dedicated Grafana plugin because most teams already have Infinity for other API integrations, and it works fine for our shape of data.

Point it at the MonPG API

In Infinity datasource config: type URL, base URL https://api.monpg.app/api/v1, auth Bearer token using a MonPG API key with the read:metrics scope. Generate the key under Settings → API Keys.

Sample query

To pull TPS for server 4 over the dashboard's time range:

URL:    /servers/4/metrics/timeseries
Params:
  metric: tps_commit
  from:   $__from:date
  to:     $__to:date
  bucket: $__interval
  aggregation: avg

Parser: JSON
Root selector: $.points
Columns:
  - selector: t,  type: time
  - selector: v,  type: number, alias: tps_commit

Add a server-picker variable: query /servers, parse $.data[*], use id as value and name as text. Now the panel re-renders for whichever server you pick from the dropdown.

Pre-built dashboards

We publish a couple of reference dashboards on Grafana Labs as JSON imports. Search "MonPG" at grafana.com/grafana/dashboards. They're starting points — most teams fork them and trim to taste.