A metrics gathering HarmonyMod for Rust game servers.
max-values-per-tag
& max-series-per-database
to 0, this is required due to the volume of data that is stored for player based metrics
NOTE: Failure to do this will eventually result in metrics submission failures and the loss of data
NOTE: A good starting point for a retention policy is a total duration of 12 weeks and a shard group duration of 24 hours
write
permissions on the newly create databaseHarmonyMods
folder in your rust server directoryHarmonyMods_Data/ServerMetrics/Configuration.json
servermetrics.reloadcfg
WARNING: Never update or delete a HarmonyMod DLL file when the rust server is running, this can lead to your server throwing random Invalid IL exceptions and eventually crash
HarmonyMods_Data/ServerMetrics/Configuration.json
{
"Enabled": true,
"Influx Database Url": "https://my-influx-database:8086",
"Influx Database Name": "rust-server-metrics",
"Influx Database User": "my-database-user",
"Influx Database Password": "my-super-secret-password-thats-a-decent-size",
"Server Tag": "us-10x",
"Debug Logging": false,
"Amount of metrics to submit in each request": 1000
}
If set to true, the mod will collect and submit metrics to your configured InfluxDb.
The Url that your InfluxDb is accessible at.
NOTE: It is highly recommended that you setup a valid SSL certificate for this if you plan to access the database over the internet
The name of the database setup in step 4.
The username of a user created in step 5.
The password for the user created in step 5.
This is a static tag that is added to all records submitted by your rust server to the database, this tag should be different for each rust server
TIP: You can have multiple rust game servers submit data the same InfluxDb database if you use different server tags for them
Setting this to true with output the raw HTTP response for failed submission attempts, it is reccomended to disable this once your server is up and connected as it can cause performance issues.
This field configures exactly how many individual statistics records should be sent in each HTTP request, too high will result in sending of records taking large amounts of time and potentially causing FPS issues on your server, too low and the Mod will begin discarding records as they are being generated faster than they are being sent.
The minimum value this field can be set to it 1000.
NOTE: 200 -> 600 pop servers have been tested without issue with this set to 1000
If you have made changes to the config file directly, you can run this console command and it will load the changes.
This command will output whether the Mod is ready to collect metrics, whether the report uploader is sending a http request and how many records are in the send buffer.
The report buffer is hardcoded to a size of 100,000 reports, once this buffer size is exceeded, the Mod will begin to discard reports, of which will cause data to be missing from your Grafana dashboard.
If you plan to play around with the Amount of metrics to submit in each request
configuration variable, ensure you watch the size of the report buffer.
IMPORTANT - Failure to secure your InfluxDB can result in your data being accessible to the general public! Please follow all steps below
Edit the InfluxDB Configuration File: Locate the InfluxDB configuration file (influxdb.conf
), usually found in /etc/influxdb/
.
Enable HTTP Authentication:
[http]
section.auth-enabled
to true
.
[http]
auth-enabled = true
Restart InfluxDB: Apply the configuration changes by restarting the InfluxDB service.
sudo systemctl restart influxdb
Create Users with Passwords:
influx
<username>
and <password>
with your desired credentials).
CREATE USER <username> WITH PASSWORD '<password>' WITH ALL PRIVILEGES
Obtain SSL Certificates: You can use a tool like Let's Encrypt or generate a self-signed certificate.
Configure HTTPS in InfluxDB:
influxdb.conf
file, locate the [http]
section again.https-enabled
to true
.[http]
https-enabled = true
https-certificate = "/path/to/your/certificate.pem"
https-private-key = "/path/to/your/privatekey.pem"
Restart InfluxDB to apply the HTTPS settings.
sudo systemctl restart influxdb
8086
for HTTP by default, or 8084
if HTTPS is enabled).