galexrt / srcds_exporter

Prometheus exporter for SRCDS Gameserver using Source RCON.
Apache License 2.0
25 stars 6 forks source link

Rework Source server information querying to use A2S instead of RCON #24

Open sappykun opened 4 months ago

sappykun commented 4 months ago

I would like to propose that this library start using A2S queries instead of RCON commands to gather its data, or at least provide an option to do so.

I help manage a TF2 server with some other admins. One of them is using this container to gather statistics on how often certain maps are played, etc.

Every 5 seconds or so, the server console gets sent a status command, which dumps a paragraph of information in the server console. Since I use the console quite a bit to recompile and test Sourcemod plugins, this constant spam is incredibly annoying to work with, and I've had to tell the other admin to turn off the exporter.

I am not entirely sure what information this project gathers and displays, but the information you get from an A2S query is mostly the same as the output of status, minus the edict count.

For example, here is an equivalent Python library that allows for A2S queries: https://github.com/Yepoleb/python-a2s (Demo)

Pros of A2S:

Cons of A2S:

galexrt commented 1 month ago

@sappykun Sorry for the late response.

There seems to be this package available for using A2S with Golang https://github.com/rumblefrog/go-a2s

I would have to see when I have time to implement A2S as a secondary "connection type" option. Adding help wanted label if anyone wants to look into this.