itzg/mc-monitor

[Enhancement] Add more data obtained through rcon

Opened this issue · 4 comments

Currently this tool relies solely on querying the server to provide stats. My idea is to add functionality to obtain additional metrics when rcon access is available. Although this would require either configuration or detection of the server brand and version to know what commands to use this could be useful for having tps and mspt stats.

itzg commented

Thanks, this is an interesting enhancement idea.

...however, RCON responds with unstructured text and worse still doesn't even include newline delimiters.

I'll have to give this some more thought, but off hand I'm not comfortable with introducing RCON here since the design of mc-monitor is focused on the official structured protocol responses.

I would prefer to see a separate tool introduced that uses rcon and is extensible in a way that it knows how to parse the text responses for the respective commands, and export those accordingly.

Looking at the code NeoForge and Forge have a fix in place for the missing newlines and looking at another prometheus data provider for minecraft it can be retrieved via the tps command (/forge tps / /neoforge tps) and parsed via regex (see: https://github.com/dirien/minecraft-prometheus-exporter/blob/main/pkg/exporter/exporter.go#L160)

itzg commented

Thanks for the extra info -- that's really good to know.

I was going to say, another tool probably provides what you need. Why not just use that?

the problem is that those tools are all currently missing neoforge support and expose way more metrics than I need which could put strain on the server always running the commands