speedtest_exporter

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

Speedtest Exporter

A Prometheus exporter for monitoring internet speed with speedtest.net.

Inspired by danopstech/speedtest_exporter which is no longer actively maintained.

Features

  • Measures download/upload speeds and latency
  • Exports metrics in Prometheus format
  • Supports specific speedtest.net server selection (uses speedtest.net API via speedtest-go)
  • Auto-selects nearest server when not specified or if requested server is unavailable
  • Includes geographical metadata (user/server location)

Quick Start

Usage: speedtest_exporter [flags]

A Prometheus exporter for monitoring internet speed with speedtest.net

Flags:
  -h, --help                    Show context-sensitive help.
      --address=":8080"         The address where the server should listen on ($ADDRESS).
      --server-id=0             Speedtest.net server ID (0 = auto-select nearest server) ($SERVER_ID)
      --log-format="console"    Set the output format of the logs. Must be "console" or "json" ($LOG_FORMAT).
      --log-level=INFO          Set the log level. Must be "DEBUG", "INFO", "WARN" or "ERROR" ($LOG_LEVEL).
      --log-add-source          Whether to add source file and line number to log records ($LOG_ADD_SOURCE).
      --version                 Print version information and exit
Using Docker
docker run -d -p 8080:8080 ghcr.io/veerendra2/speedtest_exporter:latest

Docker Compose

---
name: speedtest_exporter
services:
  speedtest_exporter:
    image: ghcr.io/veerendra2/speedtest_exporter:latest
    container_name: speedtest_exporter
    ports:
      - "8080:8080"
    restart: unless-stopped
    hostname: speedtest_exporter

Metrics

speedtest_download_speed_bps{test_uuid="ca2d9a4b-5743-45a2-8391-4da887d6b33e"} 2.6180952517756084e+08
# HELP speedtest_latency_seconds Network latency to the speedtest server in seconds.
# TYPE speedtest_latency_seconds gauge
speedtest_latency_seconds{test_uuid="ca2d9a4b-5743-45a2-8391-4da887d6b33e"} 0.028829883
# HELP speedtest_scrape_duration_seconds Total time taken to complete the speedtest.
# TYPE speedtest_scrape_duration_seconds gauge
speedtest_scrape_duration_seconds{test_uuid="ca2d9a4b-5743-45a2-8391-4da887d6b33e"} 24.600010136
# HELP speedtest_status Whether the speedtest was successful (-1 = partial success, 0 = failure, 1 = success).
# TYPE speedtest_status gauge
speedtest_status{distance="143.150308",server_country="Germany",server_id="36896",server_lat="50.8892",server_lon="10.8789",server_name="speed.alphacron.de.prod.hosts.ooklaserver.net:8080",test_uuid="ca2d9a4b-5743-45a2-8391-4da887d6b33e",user_ip="REDACTED",user_isp="Vodafone Germany",user_lat="REDACTED",user_lon="REDACTED"} 1
# HELP speedtest_upload_speed_bps Upload speed in bits per second.
# TYPE speedtest_upload_speed_bps gauge
speedtest_upload_speed_bps{test_uuid="ca2d9a4b-5743-45a2-8391-4da887d6b33e"} 5.188586940214216e+07

Dashboard

  • Download dashboard json here

grafana-dashboard-screenshot.png

Prometheus Configuration

scrape_configs:
  - job_name: "speedtest"
    scrape_interval: 1h
    scrape_timeout: 2m
    static_configs:
      - targets: ["speedtest_exporter:8080"]

Build & Test

Install Taskfile: Installation Guide

# Available tasks
task --list
task: Available tasks for this project:
* all:                   Run comprehensive checks: format, lint, security and test
* build:                 Build the application binary for the current platform
* build-docker:          Build Docker image
* build-platforms:       Build the application binaries for multiple platforms and architectures
* fmt:                   Formats all Go source files
* install:               Install required tools and dependencies
* lint:                  Run static analysis and code linting using golangci-lint
* run:                   Runs the main application
* security:              Run security vulnerability scan
* test:                  Runs all tests in the project      (aliases: tests)
* vet:                   Examines Go source code and reports suspicious constructs

Install GoReleaser: Installation Guide

# Build locally
goreleaser release --snapshot --clean
...
  • Dev compose stack
docker compose -f compose-dev.yml up --build --force-recreate -d

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL