redis_exporter prometheus example
Here is an example configuration for using the Redis exporter with Prometheus:
-
First, download the Redis exporter binary from the official GitHub repository: https://github.com/oliver006/redis_exporter/releases
-
Extract the files and create a configuration file named "redis.yml" with the following contents:
redis_address: "redis://<redis-host>:<redis-port>"
redis_password: "<redis-password>"
redis_alias: "<redis-alias>"
Note: Replace <redis-host>, <redis-port>, <redis-password>, and <redis-alias> with your Redis instance's details.
- Run the Redis exporter with the following command:
./redis_exporter --redis.config redis.yml
- Add the following configuration to your Prometheus configuration file:
scrape_configs:
- job_name: 'redis'
static_configs:
- targets: ['<redis-exporter-host>:<redis-exporter-port>']
Note: Replace <redis-exporter-host> and <redis-exporter-port> with the details of the host where the Redis exporter is running.
-
Restart Prometheus to apply the changes.
-
Verify that the Redis metrics are being scraped by visiting the Prometheus web interface and checking the "Targets" page. You should see a target named "redis" with a "UP" status.
-
You can now create your own Prometheus queries and visualizations to monitor your Redis instance's performance.
原文地址: https://www.cveoy.top/t/topic/w3S 著作权归作者所有。请勿转载和采集!