https://github.com/itning/3x-ui-traffic-exporter
Exporter for traffic information from 3x-ui to Prometheus.
https://github.com/itning/3x-ui-traffic-exporter
3x-ui exporter prometheus traffic
Last synced: 8 months ago
JSON representation
Exporter for traffic information from 3x-ui to Prometheus.
- Host: GitHub
- URL: https://github.com/itning/3x-ui-traffic-exporter
- Owner: itning
- License: apache-2.0
- Created: 2025-03-11T08:28:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-26T13:10:55.000Z (10 months ago)
- Last Synced: 2025-10-29T08:30:15.054Z (8 months ago)
- Topics: 3x-ui, exporter, prometheus, traffic
- Language: Go
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README-cn.md
- License: LICENSE
Awesome Lists containing this project
README
3x-ui Traffic Exporter
[](https://github.com/itning/3x-ui-traffic-exporter/stargazers)
[](https://github.com/itning/3x-ui-traffic-exporter/network/members)
[](https://github.com/itning/3x-ui-traffic-exporter/watchers)
[](https://github.com/itning?tab=followers)
[](https://github.com/itning/3x-ui-traffic-exporter/issues)
[](https://github.com/itning/3x-ui-traffic-exporter/blob/master/LICENSE)
[](https://github.com/itning/3x-ui-traffic-exporter/commits)
[](https://github.com/itning/3x-ui-traffic-exporter)
[](https://github.com/itning/hit-count)
---
# 介绍
功能:将3x-ui中的流量信息上报给Prometheus
实现效果:

在3x-ui中:

# 使用
```shell
./3x-ui-traffic-exporter-linux-amd64 --web.listen-address=":9100"
```
```text
# HELP email_download_bytes_total Total bytes downloaded by each email.
# TYPE email_download_bytes_total counter
email_download_bytes_total{email="60fvu4mn",enable="1"} 1.247432473107e+12
email_download_bytes_total{email="6g0ff2mh",enable="1"} 1.4792804919e+10
email_download_bytes_total{email="jk8120as",enable="1"} 2.725568336e+09
email_download_bytes_total{email="rda66ai2",enable="1"} 1.78623051e+08
# HELP email_upload_bytes_total Total bytes uploaded by each email.
# TYPE email_upload_bytes_total counter
email_upload_bytes_total{email="60fvu4mn",enable="1"} 2.24460727439e+11
email_upload_bytes_total{email="6g0ff2mh",enable="1"} 1.43013856e+08
email_upload_bytes_total{email="jk8120as",enable="1"} 1.33524713e+08
email_upload_bytes_total{email="rda66ai2",enable="1"} 4.6806666e+07
```
默认使用3x-ui sqlite数据库位置为:`/etc/x-ui/x-ui.db`
如果不在默认位置可以通过参数修改,例如`--db-path=/home/xui.db`
支持TLS:`--web.config.file=web-config.yml`
具体配置:[exporter-toolkit web-configuration](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md)
# 感谢
