A Speedtest exporter for Prometheus.
Forked from https://github.com/danopstech/speedtest_exporter since there has not been any updates there for a few years. I will try to keep the binary up to date and fix any issues I find since I find this tool useful, but I will not maintain the docker images since I don't use them.
speedtest_exporter is configured by optional command line flags
$ ./speedtest_exporter --help
Usage of speedtest_exporter:
-listen-address string
address to listen on (default "0.0.0.0")
-port string
listening port to expose metrics on (default "9090")
-server_fallback
If the server_id given is not available, should we fallback to closest available server
-server_id int
Speedtest.net server ID to run test against, -1 will pick the closest server to your location (default -1)
-timeout int
request timeout for the execution of the speedtest (default 60)
For pre-built binaries please take a look at the releases.
Configure Prometheus to scrape metrics from localhost:9090/metrics
This exporter locks (one concurrent scrape at a time) as it conducts the speedtest when scraped, remember set scrape interval, and scrap timeout accordingly as per example.
...
scrape_configs
- job_name: speedtest
scrape_interval: 60m
scrape_timeout: 60s
static_configs:
- targets: ['localhost:9090']
...# HELP speedtest_download_speed_Bps Last download speedtest result
# TYPE speedtest_download_speed_Bps gauge
# HELP speedtest_latency_seconds Measured latency on last speed test
# TYPE speedtest_latency_seconds gauge
# HELP speedtest_scrape_duration_seconds Time to preform last speed test
# TYPE speedtest_scrape_duration_seconds gauge
# HELP speedtest_up Was the last speedtest successful.
# TYPE speedtest_up gauge
# HELP speedtest_upload_speed_Bps Last upload speedtest result
# TYPE speedtest_upload_speed_Bps gauge

