caarlos0 / speedtest-exporter

Exports speedtest-cli metrics in the prometheus format
Apache License 2.0
51 stars 7 forks source link

Adds optional flags to specify a server, and include server details in metrics #11

Closed lucymhdavies closed 1 year ago

lucymhdavies commented 2 years ago

--server <ID>, or -s <ID> will force the Speedtest CLI to use the specified server. You can run speedtest -L to get a list of some of your local servers.

--showServerLabels will include details of the server in the metrics output. For example, without this:

speedtest_download_bytes 1.31984368e+08
speedtest_download_bytes_second 2.7792423e+07

And with:

speedtest_download_bytes{server_country="United Kingdom",server_host="speedtest.tnp.net.uk",server_location="Manchester",server_name="TNP Ltd."} 1.31984368e+08
speedtest_download_bytes_second{server_country="United Kingdom",server_host="speedtest.tnp.net.uk",server_location="Manchester",server_name="TNP Ltd."} 2.7792423e+07

Closes https://github.com/caarlos0/speedtest-exporter/issues/10

lucymhdavies commented 2 years ago

You probably would not want to use --showServerLabels in isolation, as you're going to end up with disconnected metrics in Prometheus:

image

But it's useful to help determine which server provides the best results

caarlos0 commented 1 year ago

cool, thank you, sorry for the delay reviewing it!