Repository navigation
Data sources
The dashboard reads two data sources, each through a variable at the top:
| Variable | Data source | What it feeds |
|---|---|---|
| Prometheus | Prometheus scraping minecraft-exporter | Every graph, stat, and bar chart |
| WorldAPI | Infinity, pointed at WorldAPI | The “Chat”, “Events”, and “Console warnings and errors” tables |
Without the second one the dashboard still works: only those three tables stay empty. Every Infinity query only reads (GET), so a read-only token is all it needs.
- Run minecraft-exporter next to Prometheus. Its wiki shows the Docker service and the scrape job.
- Add Prometheus as a data source in Grafana, if it isn't there yet.
- Pick it in the dashboard's “Prometheus” variable.
The exporter reads what WorldAPI shows to every visitor. Give it a WorldAPI token, and the rows marked “Needs a WorldAPI token with …” fill in too:
| Permission | Rows and panels it fills |
|---|---|
system:read |
Host |
server:read |
Lag sources, the plugin list |
players:private |
Coordinates in “Online now” |
chat:read |
Chat by player |
logs:read |
The console panels |
No panel needs players:moderate, which also bans and kicks: leave it out. The “What the token can read” table in the Exporter row shows which endpoints the token opens.
The three tables ask WorldAPI directly, from Grafana's server, so the token never reaches a browser.
-
Install the Infinity plugin:
grafana cli plugins install yesoreyeram-infinity-datasource, orGF_PLUGINS_PREINSTALL_SYNC=yesoreyeram-infinity-datasourcein Docker. Restart Grafana. -
Make a read-only WorldAPI token. In WorldAPI's
config.yml:auth: tokens: - name: monitoring token: "64 random hex characters, like the output of openssl rand -hex 32" scopes: [viewer, "logs:read", "system:read"]
viewerholdsevents:readfor the event table andchat:readfor the chat.logs:readopens the console table. The exporter can use the same token. Restart the server, or run/worldapi reload. -
In Grafana, add an Infinity data source:
-
URL: your WorldAPI with
/api/v1, likehttp://minecraft:8110/api/v1. The tables ask/eventsand/server/logsunder it. - Authentication: “Bearer token”, with the token from step 2.
- Allowed hosts: the same URL. Infinity sends a token only to the hosts listed here.
-
URL: your WorldAPI with
-
Pick it in the dashboard's “WorldAPI” variable.
WorldAPI records chat only with events.chat: true in its config, so the chat table stays empty until you turn it on.
The same two data sources as a file, provisioning/datasources/minecraft.yml:
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
jsonData:
timeInterval: 15s
- name: WorldAPI
uid: worldapi
type: yesoreyeram-infinity-datasource
url: $WORLDAPI_URL
jsonData:
auth_method: bearerToken
allowedHosts: [$WORLDAPI_URL]
secureJsonData:
bearerToken: $WORLDAPI_TOKENGrafana fills $WORLDAPI_URL and $WORLDAPI_TOKEN from its environment, so the token stays out of the file.
Next: Keeping it private
Server owners
Developers