<br />
<br />
docker-compose.yaml如下
version: '3.4'
services:
exporter:
image: registry.cn-hangzhou.aliyuncs.com/kkun/downloader-exporter
container_name: downloader-exporter
restart: "always"
volumes:
- 自己修改/config.yml:/config/config.yml
ports:
- 31002:9000 #端口可以自定义
prometheus-server:
image: registry.cn-hangzhou.aliyuncs.com/kkun/prometheus
container_name: prometheus-server
restart: "always"
volumes:
- 自己修改/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command: "--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus"
ports:
- 31001:9090 #端口可以自定义
grafana-server:
image: registry.cn-hangzhou.aliyuncs.com/kkun/grafana
container_name: grafana-server
ports:
- "31000:3000" #端口可以自定义
environment:
- "GF_SECURITY_ADMIN_PASSWORD=admin"
restart: "always"
volumes:
- grafana-data:/var/lib/grafana:rw
depends_on:
- prometheus-server
volumes:
prometheus-data:
driver: local
grafana-data:
driver: local
config.yml如下
qb:
client: qbittorrent
host: http://自己修改
username: 自己修改
password: 自己修改
tr:
client: transmission
host: http://自己修改
username: 自己修改
password: 自己修改
prometheus.yml如下
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Altermanager configuration
**ing:
**managers:
- static_configs:
- targets:
# - **manager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The ** name is added as a label `**=<**_name>` to any timeseries scraped from this config.
- **_name: "downloader-exporter"
scrape_interval: 15s
scrape_timeout: 5s
static_configs:
- targets: ["填上面Prometheus的地址"]
也可以安装node-exporter监控主机的情况
apt install prometheus-node-exporter -y
普罗米修斯的配置要加上对应的节点信息
- **_name: "node-exporter"
scrape_interval: 15s
scrape_timeout: 5s
static_configs:
- targets: ["填本机地址:9100"]
BT Downloader Metrics图表ID 15006
openwrt node-exporter图表ID 11147
node-exporter图表ID 8919
登录grafana 用户名密码都是admin,第一次登录会重设密码,添加数据源
填写普罗米修斯地址
测试通过会自动保存

新建图表

选择导入

填写图表ID下一步,会自动拉取json

选择普罗米修斯数据源,图中的警告信息是我已经添加过了
在仪表板里面可以查看监控数据了

openwrt

TIP:Prometheus和Grafana数据持久化保存在/var/lib/docker 目录下,也可以自己通过挂载映射到其他目录 |