# redis-exporter **Repository Path**: pippozq/redis-exporter ## Basic Information - **Project Name**: redis-exporter - **Description**: 获取redis的运行信息,提供给prometheus做监控 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 25 - **Forks**: 13 - **Created**: 2018-06-30 - **Last Updated**: 2025-02-06 ## Categories & Tags **Categories**: dbmanager **Tags**: None ## README # redis-exporter ## [English](https://gitee.com/pippozq/redis-exporter/blob/master/doc/english.md) ## 中文说明 1. 获取redis状态信息 2. 提供prometheus metrics ## Docker 1. 容器内编译 ``` docker build -t redis-exporter:1 . ``` 2. 本地编译放入容器,此容器不超过20M ``` docker build -t redis-exporter:1 -f Dockerfile_busybox . ``` 3. docker运行 ``` docker run -p 19100:19100 -e "REDIS_FILE=/conf/redis.yml" -v /opt/redis:/conf redis-exporter:1 ``` ## 配置文件 1. 读取yaml文件 2. 支持环境变量和命令行参数传入redis.yml配置文件,命令行参数推荐宿主机使用,环境变量适用于docker ### 环境变量 ``` REDIS_FILE config/redis.yml ``` ### 命令行参数传入 ``` ./redis-exporter --redis.file=config/redis.yml ``` ### 命令行参数查看 ``` ./redis-exporter -h ``` 3. redis.yml 文件说明 支持列表传入 ``` redis_hosts: - host: 127.0.0.1 # redis host port: 6379 # redis port password: "redis" # redis password,没有密码传入空string description: "test1" # description - host: 127.0.0.1 port: 6380 password: "" description: "test2" ``` # License GNU General Public License v3.0