Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active June 5, 2019 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruanbekker/88fba97afc3d214754670bf1d4f442b1 to your computer and use it in GitHub Desktop.
Save ruanbekker/88fba97afc3d214754670bf1d4f442b1 to your computer and use it in GitHub Desktop.
Speedtest Exporter for Prometheus + Pushgateway

Resources:

go build speedtest_exporter.go
./speedtest_exporter
curl -s http://localhost:9112/metrics >> file.output

data=$(cat file.output | grep "speedtest" | grep -v "#")

curl -X POST -H  "Content-Type: text/plain" --data "$data
" https://pushgateway.domain.com/metrics/job/speedtest/instance/home

rm -rf file.output
while true; do sleep 60; bash speedtest-producer.sh ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment