{"id":13897179,"url":"https://github.com/ngosang/deluge-exporter","last_synced_at":"2025-03-20T03:31:11.217Z","repository":{"id":65985117,"uuid":"583872880","full_name":"ngosang/deluge-exporter","owner":"ngosang","description":"Prometheus exporter for the Deluge Bittorrent client","archived":false,"fork":false,"pushed_at":"2023-07-29T13:26:22.000Z","size":163,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T22:55:14.861Z","etag":null,"topics":["bittorrent","client","deluge","docker","exporter","prometheus","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngosang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-31T08:54:33.000Z","updated_at":"2024-11-13T01:50:53.000Z","dependencies_parsed_at":"2024-10-27T21:44:38.850Z","dependency_job_id":"be441bde-4e83-421e-9cbb-bb6c1b1ff938","html_url":"https://github.com/ngosang/deluge-exporter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngosang%2Fdeluge-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngosang%2Fdeluge-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngosang%2Fdeluge-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngosang%2Fdeluge-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngosang","download_url":"https://codeload.github.com/ngosang/deluge-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047647,"owners_count":20389206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bittorrent","client","deluge","docker","exporter","prometheus","python"],"created_at":"2024-08-06T18:03:24.149Z","updated_at":"2025-03-20T03:31:10.856Z","avatar_url":"https://github.com/ngosang.png","language":"Python","funding_links":["https://www.paypal.com/paypalme/diegoheras0xff"],"categories":["Python"],"sub_categories":[],"readme":"# ngosang/deluge-exporter\n\n[![Latest release](https://img.shields.io/github/v/release/ngosang/deluge-exporter)](https://github.com/ngosang/deluge-exporter/releases)\n[![Docker Pulls](https://img.shields.io/docker/pulls/ngosang/deluge-exporter)](https://hub.docker.com/r/ngosang/deluge-exporter/)\n[![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-yellow.svg)](https://www.paypal.com/paypalme/diegoheras0xff)\n[![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-f7931a.svg)](https://www.blockchain.com/btc/address/14EcPN47rWXkmFvjfohJx2rQxxoeBRJhej)\n[![Donate Ethereum](https://img.shields.io/badge/Donate-Ethereum-8c8c8c.svg)](https://www.blockchain.com/eth/address/0x0D1549BbB00926BF3D92c1A8A58695e982f1BE2E)\n\nPrometheus exporter for the [Deluge](https://deluge-torrent.org/) Bittorrent client. It is designed to use the [Deluge Web API](https://deluge.readthedocs.io/en/latest/reference/webapi.html) and to be lightweight. Tested with Deluge 2.1.\n\nThere are other Deluge exporters, like [tobbez/deluge_exporter](https://github.com/tobbez/deluge_exporter), which exposes more metrics, but I experienced reliability and performance issues. The reason is all of them use the [deluge-client](https://github.com/JohnDoee/deluge-client) for Python. That library uses the [Deluge RPC API](https://deluge.readthedocs.io/en/latest/reference/rpc.html) which is more complete than the Web API, but it is dependant on the Deluge version, has [inappropriate reconnection logic](https://github.com/tobbez/deluge_exporter/issues/23), and it uses more resources.\n\n## Install\n\n### Form source code\n\nRequirements:\n * Python 3\n * [prometheus-client](https://github.com/prometheus/client_python)\n * [requests](https://docs.python-requests.org/en/latest/index.html)\n\n```bash\npip install -r /requirements.txt\n\nexport DELUGE_URL=http://192.168.1.191:8112\nexport DELUGE_PASSWORD=\u003cpassword_here\u003e\npython deluge-exporter.py\n```\n\n### Docker\n\nDocker images are available in [GHCR](https://github.com/ngosang/deluge-exporter/pkgs/container/deluge-exporter) and [DockerHub](https://hub.docker.com/r/ngosang/deluge-exporter).\n\n```bash\ndocker pull ghcr.io/ngosang/deluge-exporter\nor\ndocker pull ngosang/deluge-exporter\n```\n\n#### Supported Architectures\n\nThe architectures supported by this image are:\n\n* linux/386\n* linux/amd64\n* linux/arm/v6\n* linux/arm/v7\n* linux/arm64/v8\n* linux/ppc64le\n* linux/s390x\n\n#### docker-compose\n\nCompatible with docker-compose v2 schemas:\n\n```yaml\n---\nversion: '2.1'\nservices:\n  deluge-exporter:\n    image: ngosang/deluge-exporter\n    container_name: deluge-exporter\n    environment:\n      - TZ=Europe/Madrid\n      - DELUGE_URL=http://192.168.1.191:8112\n      - DELUGE_PASSWORD=\u003cpassword_here\u003e\n      - LOG_LEVEL=INFO\n    ports:\n      - \"8011:8011\"\n    restart: unless-stopped\n```\n\n#### docker cli\n\n```bash\ndocker run -d \\\n  --name=deluge-exporter \\\n  -e TZ=Europe/Madrid \\\n  -e DELUGE_URL=http://192.168.1.191:8112 \\\n  -e DELUGE_PASSWORD=\u003cpassword_here\u003e \\\n  -e LOG_LEVEL=INFO \\\n  -p 8011:8011 \\\n  --restart unless-stopped \\\n  ngosang/deluge-exporter\n```\n\n## Configuration\n\nAll configuration is done with environment variables.\n\n- `DELUGE_URL`: Deluge Web UI URL. Example: `http://192.168.1.191:8112`.\n- `DELUGE_PASSWORD`: Deluge Web UI password in plain text.\n- `LISTEN_PORT`: (Optional) The address the exporter should listen on. The default is `8011`.\n- `LISTEN_ADDRESS`: (Optional) The address the exporter should listen on. The default is to listen on all addresses.\n- `LOG_LEVEL`: (Optional) Log level of the traces. The default is `INFO`.\n\n## Exported metrics\n\n```shell\n# HELP deluge_torrent_state_count Number of torrents by state\n# TYPE deluge_torrent_state_count gauge\ndeluge_torrent_state_count{state=\"all\"} 18.0\ndeluge_torrent_state_count{state=\"active\"} 0.0\ndeluge_torrent_state_count{state=\"allocating\"} 0.0\ndeluge_torrent_state_count{state=\"checking\"} 0.0\ndeluge_torrent_state_count{state=\"downloading\"} 1.0\ndeluge_torrent_state_count{state=\"seeding\"} 16.0\ndeluge_torrent_state_count{state=\"paused\"} 1.0\ndeluge_torrent_state_count{state=\"error\"} 0.0\ndeluge_torrent_state_count{state=\"queued\"} 0.0\ndeluge_torrent_state_count{state=\"moving\"} 0.0\n# HELP deluge_torrent_label_count Number of torrents by label\n# TYPE deluge_torrent_label_count gauge\ndeluge_torrent_label_count{label=\"\"} 1.0\ndeluge_torrent_label_count{label=\"all\"} 18.0\ndeluge_torrent_label_count{label=\"educational\"} 3.0\ndeluge_torrent_label_count{label=\"music\"} 14.0\n# HELP deluge_max_download Deluge metric max_download\n# TYPE deluge_max_download gauge\ndeluge_max_download 20000.0\n# HELP deluge_max_upload Deluge metric max_upload\n# TYPE deluge_max_upload gauge\ndeluge_max_upload 10000.0\n# HELP deluge_max_num_connections Deluge metric max_num_connections\n# TYPE deluge_max_num_connections gauge\ndeluge_max_num_connections 500.0\n# HELP deluge_num_connections Deluge metric num_connections\n# TYPE deluge_num_connections gauge\ndeluge_num_connections 19.0\n# HELP deluge_upload_rate Deluge metric upload_rate\n# TYPE deluge_upload_rate gauge\ndeluge_upload_rate 0.0\n# HELP deluge_download_rate Deluge metric download_rate\n# TYPE deluge_download_rate gauge\ndeluge_download_rate 152602.0\n# HELP deluge_download_protocol_rate Deluge metric download_protocol_rate\n# TYPE deluge_download_protocol_rate gauge\ndeluge_download_protocol_rate 6642.0\n# HELP deluge_upload_protocol_rate Deluge metric upload_protocol_rate\n# TYPE deluge_upload_protocol_rate gauge\ndeluge_upload_protocol_rate 9711.5\n# HELP deluge_dht_nodes Deluge metric dht_nodes\n# TYPE deluge_dht_nodes gauge\ndeluge_dht_nodes 389.0\n# HELP deluge_has_incoming_connections Deluge metric has_incoming_connections\n# TYPE deluge_has_incoming_connections gauge\ndeluge_has_incoming_connections 1.0\n# HELP deluge_free_space Deluge metric free_space\n# TYPE deluge_free_space gauge\ndeluge_free_space 3.588696727552e+012\n```\n\n## Prometheus config\n\nExample Prometheus configuration:\n\n```yaml\nscrape_configs:\n  - job_name: 'deluge-exporter'\n    static_configs:\n      - targets: ['192.168.1.100:8011']\n```\n\n## Prometheus / Alertmanager rules\n\nExample Prometheus rules for alerting:\n\n```yaml\n  - alert: DelugeTorrentsInErrorState\n    expr: deluge_torrent_state_count{state=\"error\"} \u003e 0\n    for: 0m\n    labels:\n      severity: warning\n    annotations:\n      summary: Deluge {{ $value }} torrents in error state\n      description: Deluge torrents in error state\\n  VALUE = {{ $value }}\\n  LABELS = {{ $labels }}\n```\n\n## Grafana dashboard\n\nThere is a reference Grafana dashboard in [grafana/grafana_dashboard.json](./grafana/grafana_dashboard.json).\n\n![](./grafana/grafana_dashboard.png)\n\n![](./grafana/grafana_dashboard_2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngosang%2Fdeluge-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngosang%2Fdeluge-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngosang%2Fdeluge-exporter/lists"}