
官方仓库:https://github.com/oliver006/redis_exporter
version: "3.2"
services:
redis-exporter:
image: oliver006/redis_exporter:v1.51.0
container_name: redis-exporter
restart: unless-stopped
command:
- "-redis.password-file=/redis_passwd.json"
volumes:
- /usr/share/zoneinfo/PRC:/etc/localtime
- ./redis_passwd.json:/redis_passwd.json
expose:
- 9121
ports:
- "9121:9121"新建一个redis的实例地址与密码文件,/data/redis-exporter/redis_passwd.json:
{
"redis://xxxxxxxxxxx.dcs.huaweicloud.com:6379":"",
"redis://aaaaaaaa.cn-south-1.dcs.myhuaweicloud.com:6379":"q1azw2sx"
}实例地址端口":"redis密码"实例地址端口请查看云REDIS列表或自建redis管理的实例字段。""。启动:docker-compose up -d
配置如下
- job_name: 'redis_exporter_targets'
static_configs:
- targets:
- redis://xxxx:16379
metrics_path: /scrape
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: xxxx:9121
## config for scraping the exporter itself
- job_name: 'redis_exporter'
static_configs:
- targets:
- xxxx:9121GRAFANA:Redis Exporter Dashboard 中文版 (opens new window)
模板id号:17507
