Internet connection

A comprehensive Grafana dashboard for monitoring internet connection quality, speed, and reliability using Prometheus exporters (Speedtest and Blackbox).

Internet Connection Monitoring Dashboard

A comprehensive Grafana dashboard for monitoring internet connection quality, speed, and reliability using Prometheus exporters (Speedtest and Blackbox).

Dashboard Version Grafana License

📋 Overview

This dashboard provides real-time and historical monitoring of your internet connection performance. Track download/upload speeds, latency, jitter, and website availability with detailed HTTP request analysis.

✨ Features

🚀 Speed Monitoring

  • Download Speed: Real-time bandwidth monitoring (bits per second)
  • Upload Speed: Upload bandwidth tracking with gauge visualization
  • Speed History: Time-series graph comparing download and upload speeds

📊 Latency & Quality Metrics

  • Ping Latency: Monitor response times to test servers
  • Jitter: Network stability measurement (latency variation)
  • Historical Trends: Track latency patterns over time

🌐 Website Availability

  • Uptime Timeline: Visual state timeline showing website availability
  • HTTP Request Duration: Total request time analysis
  • Detailed Phase Breakdown:
    • DNS Resolution time
    • TCP Connection time
    • TLS Handshake duration
    • Server Processing time
    • Data Transfer time

📈 Visualization Types

  • Gauge meters for instant readings
  • Time series graphs for trend analysis
  • State timeline for uptime tracking
  • Phase-specific request duration charts

🖼️ Dashboard Panels

PanelDescriptionMetric
DownloadCurrent download speed gaugespeedtest_download_bits_per_second
UploadCurrent upload speed gaugespeedtest_upload_bits_per_second
Speedtest PingLatency measurement gaugespeedtest_ping_latency_milliseconds
Speedtest GraphCombined download/upload historyMultiple metrics
UptimeWebsite availability timelineprobe_success
HTTP Request DurationTotal request timeprobe_http_duration_seconds
Speedtest JitterNetwork stability metricspeedtest_jitter_latency_milliseconds
HTTP Phase BreakdownsDetailed request analysisPhase-specific metrics

📦 Requirements

Prerequisites

  • Grafana: Version 12.0 or higher
  • Prometheus: As data source
  • Speedtest Exporter: For bandwidth and latency metrics
  • Blackbox Exporter: For website monitoring and HTTP probes

Required Panels/Plugins

  • Gauge panel
  • Time series panel
  • State timeline panel

🚀 Installation

Method 1: Import via Grafana UI

  1. Log in to your Grafana instance
  2. Navigate to DashboardsNewImport
  3. Paste the dashboard JSON or upload the JSON file
  4. Select your Prometheus data source
  5. Click Import

Method 2: Import via Dashboard ID

(If published to Grafana.com)

  1. Navigate to DashboardsNewImport
  2. Enter the dashboard ID: XXXXX
  3. Click Load
  4. Select your Prometheus data source
  5. Click Import

⚙️ Configuration

Speedtest Exporter Setup

Install and configure the speedtest exporter:

Bash
# Using Docker
docker run -d \
  --name speedtest-exporter \
  -p 9798:9798 \
  miguelndecarvalho/speedtest-exporter

Or using docker-compose:

YAML
version: '3'
services:
  speedtest-exporter:
    image: miguelndecarvalho/speedtest-exporter
    container_name: speedtest-exporter
    ports:
      - "9798:9798"
    restart: unless-stopped

Blackbox Exporter Setup

Configure Blackbox exporter for HTTP probes:

YAML
# blackbox.yml
modules:
  http_2xx:
    prober: http
    timeout: 5s
    http:
      valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
      valid_status_codes: []
      method: GET
      preferred_ip_protocol: "ip4"
Bash
# Using Docker
docker run -d \
  --name blackbox-exporter \
  -p 9115:9115 \
  -v /path/to/blackbox.yml:/config/blackbox.yml \
  prom/blackbox-exporter:latest \
  --config.file=/config/blackbox.yml

Prometheus Configuration

Add both exporters as scrape targets in your prometheus.yml:

YAML
scrape_configs:
  # Speedtest metrics
  - job_name: 'speedtest'
    metrics_path: /metrics
    scrape_interval: 30m  # Avoid excessive bandwidth usage
    scrape_timeout: 90s   # Speedtests can take time
    static_configs:
      - targets: ['localhost:9798']

  # Blackbox exporter for website monitoring
  - job_name: 'blackbox'
    metrics_path: /probe
    params:
      module: [http_2xx]
    static_configs:
      - targets:
        - https://www.google.com
        - https://www.cloudflare.com
        - https://www.github.com
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: localhost:9115  # Blackbox exporter address

  # Blackbox exporter metrics
  - job_name: 'blackbox-exporter'
    static_configs:
      - targets: ['localhost:9115']

Important Configuration Notes

Speedtest Scrape Interval:

  • Recommended: 30 minutes to 1 hour
  • Avoid frequent scraping to prevent excessive bandwidth usage
  • Adjust scrape_timeout to allow tests to complete (typically 60-90s)

Blackbox Targets:

  • Add the websites you want to monitor in the targets list
  • Each target will appear in the Uptime panel

📊 Metrics Reference

Speedtest Metrics

MetricDescriptionTypeUnit
speedtest_download_bits_per_secondDownload bandwidthGaugebps
speedtest_upload_bits_per_secondUpload bandwidthGaugebps
speedtest_ping_latency_millisecondsPing latencyGaugems
speedtest_jitter_latency_millisecondsJitter (latency variation)Gaugems

Blackbox Metrics

MetricDescriptionTypeUnit
probe_successProbe success status (0 or 1)Gaugeboolean
probe_http_duration_secondsTotal HTTP request durationGaugeseconds
probe_http_duration_seconds{phase="resolve"}DNS resolution timeGaugeseconds
probe_http_duration_seconds{phase="connect"}TCP connection timeGaugeseconds
probe_http_duration_seconds{phase="tls"}TLS handshake timeGaugeseconds
probe_http_duration_seconds{phase="processing"}Server processing timeGaugeseconds
probe_http_duration_seconds{phase="transfer"}Data transfer timeGaugeseconds

🎨 Customization

Adjusting Speed Thresholds

Modify the gauge thresholds based on your internet plan:

  1. Edit the Download or Upload panel
  2. Go to FieldThresholds
  3. Adjust values:
    • Green: 0 (default)
    • Blue: Your expected speed (e.g., 100 Mbps = 100000000 bps)

Adding Custom Websites to Monitor

  1. Edit your Prometheus configuration
  2. Add targets to the blackbox job
  3. Reload Prometheus configuration
  4. The Uptime panel will automatically show new targets

Modifying Speedtest Frequency

Balance between monitoring detail and bandwidth usage:

YAML
# Conservative (recommended)
scrape_interval: 1h
scrape_timeout: 90s

# Moderate
scrape_interval: 30m
scrape_timeout: 90s

# Frequent (use with caution)
scrape_interval: 15m
scrape_timeout: 90s

🔧 Troubleshooting

No Speedtest Data

  1. Verify the exporter is running:

    Bash
    curl http://localhost:9798/metrics
  2. Check if Prometheus is scraping:

    • Go to Prometheus UI → StatusTargets
    • Verify speedtest target is UP
  3. Check scrape timeout:

    • Speedtests can take 60-90 seconds
    • Ensure scrape_timeout is sufficient

No Website Uptime Data

  1. Verify Blackbox exporter is running:

    Bash
    curl 'http://localhost:9115/probe?target=google.com&module=http_2xx'
  2. Check Prometheus configuration:

    • Verify relabel_configs are correct
    • Ensure targets are properly formatted
  3. Test individual probes:

    Bash
    curl 'http://localhost:9115/probe?target=https://www.google.com&module=http_2xx'

High Jitter Values

High jitter indicates network instability:

  • Normal: < 10ms
  • Acceptable: 10-30ms
  • Poor: > 30ms

If consistently high:

  • Check for network congestion
  • Verify QoS settings on router
  • Contact ISP if persistent

Slow HTTP Request Phases

Identify bottlenecks:

  • High Resolve time: DNS issues
  • High Connect time: Network/routing problems
  • High TLS time: SSL/Certificate negotiation
  • High Processing time: Server-side delays
  • High Transfer time: Bandwidth limitations

📈 Best Practices

Monitoring Strategy

  1. Baseline Establishment: Run for 1-2 weeks to establish normal patterns
  2. Alert Thresholds: Set based on your baseline ±20%
  3. Retention: Keep at least 30 days of data for trend analysis

Performance Optimization

  1. Use appropriate scrape intervals
  2. Limit number of monitored websites (5-10 recommended)
  3. Consider using recording rules for complex queries

Alerting Recommendations

Create alerts for:

  • Download speed < 80% of expected
  • Upload speed < 80% of expected
  • Ping latency > 100ms
  • Website down for > 5 minutes
  • Jitter > 30ms consistently

📝 Example Use Cases

Home Network Monitoring

  • Track ISP performance vs. advertised speeds
  • Identify peak congestion times
  • Verify speed consistency throughout the day

Business Connectivity

  • Monitor critical website availability
  • Track SLA compliance
  • Identify network degradation patterns

ISP Accountability

  • Document speed issues for ISP support tickets
  • Compare different time periods
  • Verify service improvements after ISP intervention

🤝 Contributing

Contributions are welcome! Suggestions for improvements:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Open a pull request

📝 Changelog

Version 1.0.0 (2024)

  • Initial release
  • Speedtest integration (download, upload, ping, jitter)
  • Blackbox integration (uptime, HTTP phases)
  • Gauge and time series visualizations
  • State timeline for uptime tracking

📄 License

This dashboard is released under the MIT License.

Exporters

Documentation

Community

💬 Support

For issues or questions:

  • Open an issue on GitHub
  • Check the exporter documentation
  • Visit the Grafana community forums

🙏 Acknowledgments

  • Thanks to the Speedtest exporter maintainers
  • Prometheus and Blackbox Exporter teams
  • The Grafana community for visualization best practices

⚠️ Important Notes

Bandwidth Considerations

Running speedtests consumes bandwidth:

  • Typical test: 100-500 MB
  • Hourly tests: ~12 GB/day
  • 30-minute tests: ~24 GB/day

Recommendation: Use 30-60 minute intervals to balance monitoring vs. bandwidth usage.

ISP Data Caps

If you have a data cap, monitor your speedtest frequency:

  • Calculate daily usage: tests_per_day × 0.5 GB
  • Adjust scrape interval accordingly
  • Consider reducing frequency during high-usage periods

Monitor your internet connection effectively! 🌐📊⚡

Revisions
RevisionDescriptionCreated

Get this dashboard

Import the dashboard template

or

Download JSON

Datasource
Dependencies