heathcliff26/speedtest-exporter

By heathcliff26

Updated 7 days ago

speedtest-exporter for prometheus

Image
Networking
Monitoring & observability
0

10K+

heathcliff26/speedtest-exporter repository overview

CI Coverage Status Editorconfig Check Generate go test cover report Renovate

speedtest-exporter

This project is a prometheus exporter for speedtests implemented in go. It runs automatically speedtests with the speedtest.net API and exports the result as prometheus metrics. It supports native speedtest by using speedtest-go.

I created this project because i saw Jeff Geerling's video about his speedtest setup. When looking into it, he uses a python based speedtest-exporter. At this point i could have just used that as well, but i was bored and wanted to program something. Hence this project.

One important functionality is that this projects implements prometheus remote_write, so it can push the metrics directly to e.g. grafana cloud.

Table of Contents

Container Images

Image location
Container RegistryImage
Github Containerghcr.io/heathcliff26/speedtest-exporter
Docker Hubdocker.io/heathcliff26/speedtest-exporter
Tags

There are different flavors of the image:

Tag(s)Description
latestLast released slim version of the image.
slimContains only the speedtest-exporter binary and uses native golang implementation.
cliAlpine based container that also contains the speedtest.net cli client binary. Uses the speedtest.net cli to run the tests.
vX.Y.ZReleased version of the image.

Usage

To run the image with default settings simply use:

podman run -d -p 8080:8080 ghcr.io/heathcliff26/speedtest-exporter:slim

You can then view your metrics under http://localhost:8080/metrics.

By default the last result will be cached to disk. To persist this between container runs, mount a volume at /cache:

podman run -d -p 8080:8080 -v speedtest-cache:/cache ghcr.io/heathcliff26/speedtest-exporter:slim

Configuration

Output of speedtest-exporter -h

Usage of speedtest-exporter:
  -config string
        Optional: Path to config file
  -env
        Used together with -config, when set will expand enviroment variables in config
  -version
        Show the version information and exit

An example configuration can be found here.

Metrics

The following metrics are exported:

MetricDescription
speedtest_jitter_latency_millisecondsSpeedtest current Jitter in ms
speedtest_ping_latency_millisecondsSpeedtest current Ping in ms
speedtest_download_megabits_per_secondSpeedtest current Download Speed in Mbit/s
speedtest_upload_megabits_per_secondSpeedtest current Upload Speed in Mbit/s
speedtest_data_used_megabytesData used for speedtest in MB
speedtest_upIndicates if the speedtest was successful

Dashboard

A ready made dashboard for the exporter can be imported from json. The json file can be found here.

The dashboard is also published on grafana.com with the id 20115.

Here is a preview of the dashboard:

Tag summary

Content type

Image

Digest

sha256:6936a4bc9

Size

526 Bytes

Last updated

7 days ago

docker pull heathcliff26/speedtest-exporter:sha256-589dcc65b7524b78eee817bf473abcc1781a6e2b460a50d8cb6d0777fb552740.sig