ts3exporter
ts3exporter copied to clipboard
Including metrics for packet loss
Hi!
First of all, thanks for a great application. I use it for my TeamSpeak server at home and it works great, even if it probably is overkill!
I was wondering if it would be possible to include metrics for packet loss. From TeamSpeak's ServerQuery documentation it looks like there are 4 different values for packet loss data:
virtualserver_total_packetloss_control - The average packet loss for control data on the virtual server
virtualserver_total_packetloss_keepalive - The average packet loss for keepalive data on the virtual server
virtualserver_total_packetloss_speech - The average packet loss for speech data on the virtual server
virtualserver_total_packetloss_total - The average packet loss for all data on the virtual server
I don't know if all of them would be interesting to collect or if virtualserver_total_packetloss_total
would be enough to keep it simple.
This is an example how the values looks on my server that actually has issues with packet loss on incoming traffic right now:
'virtualserver_total_packetloss_control': '0.0148',
'virtualserver_total_packetloss_keepalive': '0.0001',
'virtualserver_total_packetloss_speech': '0.0034',
'virtualserver_total_packetloss_total': '0.0001',
I also have quick off-topic question about the ts3_exporter_data_model_refresh_errors_total
metric. It doesn't look like that metric is available for me under the /metrics endpoint at all (example /metrics data). I have tried running ts3exporter against two different TeamSpeak servers and building it locally but without success. But it could also be that does not understand how it works, I'm still new to the whole Prometheus thing. The reason I ask is because I saw it in the alert example but couldn't find it on my instance.
Thanks! /Daniel
Hi again!
I also saw that go-ts3
exposes a value called PacketLossTotalAvg
in the ServerConnectionInfo struct. I'm not exactly sure what the differences between the connection_ and the virtualserver_ values are, but in my case (with only one virtual server) the PacketLossTotalAvg
is exactly the same value as virtualserver_total_packetloss_total
. The PacketLossTotalAvg
value is also only available if you run a serverrequestconnectioninfo
query, so if I understand things correctly that would require an additional query in ts3exporter since only a serverinfo
is being used right now (where the other virtualserver_ and connection_ values are available).
I'm new to Go and programming in general but I tried to add the virtualserver_total_packetloss_total
in a local fork. I have been using it for a couple of days against my own TS3 instance and it seems to work fine (test graph in Grafana). I assume it should be a Gauge type in Prometheus since it is a value that goes up and down.
/Daniel
Hey @jagardaniel did you delete your fork for some reason? do you happen to have the diff somewhere? I would be interested, thanks!
Hello @timhae and sorry for the late response. It looks like I removed the fork I cleaned up a bit a while ago. I don't use Prometheus or this plugin anymore but I just created a new fork where I included the packet loss metrics again. You should be able to find it here.
I'm not much more of a developer than I was 3 years ago but I tried it against a test TeamSpeak instance where I simulated packet loss and it seems to work fine. So these four metrics should now be available:
virtualserver_total_packetloss_control - The average packet loss for control data on the virtual server
virtualserver_total_packetloss_keepalive - The average packet loss for keepalive data on the virtual server
virtualserver_total_packetloss_speech - The average packet loss for speech data on the virtual server
virtualserver_total_packetloss_total - The average packet loss for all data on the virtual server
# HELP ts3_serverinfo_total_packetloss_control average packet loss for control data
# TYPE ts3_serverinfo_total_packetloss_control gauge
ts3_serverinfo_total_packetloss_control{virtualserver="daniel test"} 0
# HELP ts3_serverinfo_total_packetloss_keepalive average packet loss for keepalive data
# TYPE ts3_serverinfo_total_packetloss_keepalive gauge
ts3_serverinfo_total_packetloss_keepalive{virtualserver="daniel test"} 0.0144
# HELP ts3_serverinfo_total_packetloss_speech average packet loss for speech data
# TYPE ts3_serverinfo_total_packetloss_speech gauge
ts3_serverinfo_total_packetloss_speech{virtualserver="daniel test"} 0
# HELP ts3_serverinfo_total_packetloss_total average packet loss for all data
# TYPE ts3_serverinfo_total_packetloss_total gauge
ts3_serverinfo_total_packetloss_total{virtualserver="daniel test"} 0.0139