Chart the worlds' players and awake time with mc-monitor #46

Open
opened 2026-10-25 21:38:06 +00:00 by hutao · 0 comments
Owner

The worlds' state is visible only right now: the in-game server list shows which worlds are asleep and how many players each has, and scripts/rcon.sh <world> list answers the same thing. Nothing records it over time, so "when do we actually play", "how long does a world stay awake" or "how often does the cap of two refuse a wake" have no answer.

Not urgent. It is worth doing once one of those questions comes up for real, and not before.

Proposal

itzg/mc-monitor export-for-prometheus, as one more container on the minecraft network, scraped by the Prometheus that Grafana already reads (localhost:9090). It pings each world with the Server List Ping and exports up/down, online players and response time per server. Then a Grafana dashboard: players online per world, and awake time per world.

A game panel (Pterodactyl/Pelican, Crafty, MCSManager) is not the answer. Each one wants to own the servers' lifecycle and config, and that would compete with the Nix-declared worlds, mc-router's wake/sleep and the cap of two, and the packs built from git.

Questions to settle first

  • Ping the containers, not mc-router. A status ping through mc-router answers for a sleeping world too (its "Asleep" motd, 0/1), so "up" would always read true. Pinging minecraftN:25565 on the docker network should fail while the world is asleep, which is the signal wanted. Probe both before building on either.
  • Confirm a status ping never wakes a world. Only a login should post up to minecraft-scaler, so a scrape every 15s must not keep worlds awake. Check journalctl -u minecraft-scaler across a few scrapes.
  • Player names are not exported, or they would end up in Prometheus and on a dashboard. Counts only, in line with the handbook's "no player list lives in this public repo".

Check

  • A world shows down while asleep and up within a minute of waking.
  • Joining moves its player count; leaving brings it back to 0.
  • Scraping for an hour wakes nothing (minecraft-scaler logs no up without a login).
The worlds' state is visible only right now: the in-game server list shows which worlds are asleep and how many players each has, and `scripts/rcon.sh <world> list` answers the same thing. Nothing records it over time, so "when do we actually play", "how long does a world stay awake" or "how often does the cap of two refuse a wake" have no answer. Not urgent. It is worth doing once one of those questions comes up for real, and not before. ## Proposal [`itzg/mc-monitor`](https://github.com/itzg/mc-monitor) `export-for-prometheus`, as one more container on the minecraft network, scraped by the Prometheus that Grafana already reads (`localhost:9090`). It pings each world with the Server List Ping and exports up/down, online players and response time per server. Then a Grafana dashboard: players online per world, and awake time per world. A game panel (Pterodactyl/Pelican, Crafty, MCSManager) is not the answer. Each one wants to own the servers' lifecycle and config, and that would compete with the Nix-declared worlds, mc-router's wake/sleep and the cap of two, and the packs built from git. ## Questions to settle first - **Ping the containers, not mc-router.** A status ping through mc-router answers for a sleeping world too (its "Asleep" motd, 0/1), so "up" would always read true. Pinging `minecraftN:25565` on the docker network should fail while the world is asleep, which is the signal wanted. Probe both before building on either. - **Confirm a status ping never wakes a world.** Only a login should post `up` to minecraft-scaler, so a scrape every 15s must not keep worlds awake. Check `journalctl -u minecraft-scaler` across a few scrapes. - **Player names are not exported**, or they would end up in Prometheus and on a dashboard. Counts only, in line with the handbook's "no player list lives in this public repo". ## Check - A world shows down while asleep and up within a minute of waking. - Joining moves its player count; leaving brings it back to 0. - Scraping for an hour wakes nothing (minecraft-scaler logs no `up` without a login).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hutao/vps#46
No description provided.