Setting Up Redis Prometheus Exporter
This guide explains how to install and run the Redis Exporter, which exposes Redis performance metrics that can be scraped by Grafana Alloy or Prometheus for visualization in Grafana Cloud.
1. Download and Install Redis Exporter
Download the latest stable version (v1.61.0) from the official GitHub releases:
cd /tmp
wget https://github.com/oliver006/redis_exporter/releases/download/v1.61.0/redis_exporter-v1.61.0.linux-amd64.tar.gz
Extract and install the binary:
tar -xzf redis_exporter-v1.61.0.linux-amd64.tar.gz
mv redis_exporter-v1.61.0.linux-amd64/redis_exporter /usr/local/bin/
chmod +x /usr/local/bin/redis_exporter
2. Create a Systemd Service
Create a service file to manage Redis Exporter as a background process:
/etc/systemd/system/redis-exporter.service
Add the following configuration:
[Unit]
Description=Redis Exporter
After=network.target
[Service]
ExecStart=/usr/local/bin/redis_exporter --redis.addr=rediss://redis-hostname:6380 --redis.password=''
Restart=always
[Install]
WantedBy=multi-user.target
This ensures the exporter connects securely to your Azure Redis instance (rediss:// indicates TLS).
3. Enable and Start the Service
Reload systemd and start the exporter:
systemctl daemon-reload
systemctl enable redis-exporter
systemctl start redis-exporter
4. Verify the Exporter
Check that it’s active and running:
systemctl status redis-exporter
By default, Redis Exporter listens on port 9121. Verify that it’s returning metrics:
curl http://localhost:9121/metrics
Example output:
# HELP redis_up Information about the Redis instance
# TYPE redis_up gauge
redis_up 1
5. Configure Grafana Alloy Scrape
If you’re using Grafana Alloy to forward metrics to Grafana Cloud, edit the configuration file:
/etc/alloy/config.alloy
Add the following block:
prometheus.scrape "redis" {
targets = [
{ __address__ = "127.0.0.1:9121", },
]
metrics_path = "/metrics"
forward_to = [prometheus.relabel.metrics_instance.receiver]
}
Then restart Alloy to apply changes:
systemctl restart alloy
This tells Alloy to scrape the Redis Exporter on 127.0.0.1:9121 and forward all collected metrics to your Grafana Cloud metrics pipeline.