#metrics #metrics-exporter #prometheus-exporter #tags #torrent #detailed #aggregated

app qbittorrent-metrics-exporter

A Prometheus exporter for qBittorrent that provides detailed torrent metrics with support for categories and tags. Collects both per-torrent statistics and aggregated metrics grouped by categories and tags.

1 unstable release

new 0.1.0 Feb 21, 2025

#93 in Machine learning

GPL-3.0 license

35KB
306 lines

qBittorrent Metrics Exporter

Crates.io License: GPLv3

A Prometheus exporter for qBittorrent that provides detailed torrent metrics with support for categories and tags. Collects both per-torrent statistics and aggregated metrics grouped by categories and tags.

What's Included

  • Monitor multiple qBittorrent instances simultaneously
  • Track individual torrent details (speed, size, ratio, etc.)
  • See aggregated stats for custom tags and categories
  • Ready-made metrics for Grafana dashboards
  • Configuration through environment variables

Installation

From Crates.io

cargo install qbittorrent-metrics-exporter

NixOS

Add to your configuration.nix:


services.prometheus.exporters.qbittorrent = {
  enable = true;
  port = 8000;
  host = "localhost";
  qbittorrentHosts = "http://localhost:8080";
  qbittorrentUsername = "your_username";
  qbittorrentPassword = "your_password";
};

Configuration

Configure through environment variables:

Variable Default Description
PORT 8000 Port to expose metrics endpoint
HOST 0.0.0.0 Host address to bind to
QBITTORRENT_HOSTS http://localhost Comma-separated list of qBittorrent WebUI URLs
QBITTORRENT_USERNAME admin qBittorrent WebUI username
QBITTORRENT_PASSWORD adminadmin qBittorrent WebUI password

Metrics

Per Torrent/Category/Tag (with name/category/hash labels):

  • Download/upload speeds
  • Downloaded/uploaded total/session
  • Progress percentage
  • Seeding time
  • Share ratio
  • Active peers (leechers/seeds)

Full list available at /metrics endpoint.

Prometheus Integration

scrape_configs:
  - job_name: "qbittorrent"
    scrape_interval: 60s
    static_configs:
      - targets: ["exporter-host:8000"]

License

This project is licensed under GNU GPLv3.

Dependencies

~12–26MB
~396K SLoC