Skip to main content

Prometheus exporter for qbittorrent

Project description

Prometheus qBittorrent exporter

A prometheus exporter for qBittorrent. Get metrics from a server and offers them in a prometheus format.

Coverage badge

How to use it

You can install this exporter with the following command:

pip3 install prometheus-qbittorrent-exporter

Then you can run it with

qbittorrent-exporter

Another option is run it in a docker container.

docker run \
    -e QBITTORRENT_PORT=8080 \
    -e QBITTORRENT_HOST=myserver.local \
    -p 8000:8000 \
    ghcr.io/esanchezm/prometheus-qbittorrent-exporter

Add this to your prometheus.yml

  - job_name: "qbittorrent_exporter"
    static_configs:
        - targets: ['yourqbittorrentexporter:port']

The application reads configuration using environment variables:

Environment variable Default Description
QBITTORRENT_HOST qbittorrent server hostname
QBITTORRENT_PORT qbittorrent server port
QBITTORRENT_SSL False Whether to use SSL to connect or not. Will be forced to True when using port 443
QBITTORRENT_URL_BASE "" qbittorrent server path or base URL
QBITTORRENT_USER "" qbittorrent username
QBITTORRENT_PASS "" qbittorrent password
EXPORTER_ADDRESS 0.0.0.0 Exporter listening IP address
EXPORTER_PORT 8000 Exporter listening port
EXPORTER_LOG_LEVEL INFO Log level. One of: DEBUG, INFO, WARNING, ERROR, CRITICAL
METRICS_PREFIX qbittorrent Prefix to add to all the metrics
VERIFY_WEBUI_CERTIFICATE True Whether to verify SSL certificate when connecting to the qbittorrent server. Any other value but True will disable the verification
EXPORT_METRICS_BY_TAG False Whether to export tag-based torrent count metrics

Metrics

These are the metrics this program exports, assuming the METRICS_PREFIX is qbittorrent:

Metric name Type Description
qbittorrent_up gauge Whether the qBittorrent server is answering requests from this exporter. A version label with the server version is added.
qbittorrent_connected gauge Whether the qBittorrent server is connected to the Bittorrent network.
qbittorrent_firewalled gauge Whether the qBittorrent server is connected to the Bittorrent network but is behind a firewall.
qbittorrent_dht_nodes gauge Number of DHT nodes connected to.
qbittorrent_total_peer_connections gauge Total number of peer connections.
qbittorrent_dl_info_data counter Data downloaded since the server started, in bytes.
qbittorrent_up_info_data counter Data uploaded since the server started, in bytes.
qbittorrent_alltime_dl_total counter Total historical data downloaded, in bytes.
qbittorrent_alltime_ul_total counter Total historical data uploaded, in bytes.
qbittorrent_torrents_count gauge Number of torrents for each category and status. Example: qbittorrent_torrents_count{category="movies",status="downloading"}
qbittorrent_tagged_torrents_count gauge Number of torrents for each tag and status. Enabled via EXPORT_METRICS_BY_TAG=True. Example: qbittorrent_tagged_torrents_count{tag="linux",status="downloading"}

Screenshot

More info

License

This software is released under the GPLv3 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prometheus_qbittorrent_exporter-1.7.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prometheus_qbittorrent_exporter-1.7.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file prometheus_qbittorrent_exporter-1.7.0.tar.gz.

File metadata

  • Download URL: prometheus_qbittorrent_exporter-1.7.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.9 CPython/3.11.15 Linux/7.0.9-102.fc43.x86_64

File hashes

Hashes for prometheus_qbittorrent_exporter-1.7.0.tar.gz
Algorithm Hash digest
SHA256 1bd20117b650efda44bc10cc79b93096f07bb307faa8705e11a7e3a57794a771
MD5 854714ad42acd023363d2f82b9f273c6
BLAKE2b-256 fdeb393141120e739dc3ffe7327a4ca9f52bcb108d543633a5d7007eb3ab1dc4

See more details on using hashes here.

File details

Details for the file prometheus_qbittorrent_exporter-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prometheus_qbittorrent_exporter-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f849b7e1a548850fc76ddc03cf8e362d5dc914adbdbc45360465d07d33d55337
MD5 1a0467d1a8f540618c631daefd520f23
BLAKE2b-256 cfdf144b18e198465b8091112bff8d984f066b33b13c954a708ef8ec79f700db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page