Operations 6 min read

Monitoring Redis with Prometheus and Grafana: Installation, Configuration, Visualization, and Alerting

This tutorial explains how to install Redis Exporter, configure Prometheus to scrape Redis metrics, visualize them in Grafana, and set up alert rules for Redis, providing step‑by‑step commands, configuration snippets, and screenshots for a complete monitoring solution.

DevOps Operations Practice
DevOps Operations Practice
DevOps Operations Practice
Monitoring Redis with Prometheus and Grafana: Installation, Configuration, Visualization, and Alerting

Prometheus is an open‑source monitoring system that can collect rich metrics and trigger flexible alerts, making it suitable for real‑time monitoring of Redis instances.

1. Install Redis Exporter – Redis Exporter gathers Redis metrics via the INFO and STATS commands and exposes them in a Prometheus‑compatible format.

$ wget https://github.com/oliver006/redis_exporter/releases/download/v1.36.0/redis_exporter-v1.36.0.linux-amd64.tar.gz<br/>$ tar -xvf redis_exporter-v1.36.0.linux-amd64.tar.gz<br/>$ cd redis_exporter-v1.36.0.linux-amd64/<br/>$ mv redis_exporter /usr/local/bin/

Start the exporter so it listens on the default port 9121: $ redis_exporter -redis.addr localhost:6379 & Use --redis.addr to specify the Redis address and add -redis.password <password> if authentication is required.

2. Configure Prometheus – Add a scrape job for Redis in prometheus.yml:

scrape_configs:<br/>  - job_name: 'redis'<br/>    scrape_interval: 5s<br/>    static_configs:<br/>    - targets: ['192.168.214.112:9121']

This configuration defines a job named redis that polls the exporter every five seconds.

Start Prometheus with the new configuration:

$ prometheus --config.file /etc/prometheus/prometheus.yml &

After Prometheus reloads, the Redis metrics will be collected and stored locally.

3. Visualize Metrics with Grafana – Add Prometheus as a data source, import a Redis dashboard template, and configure it to use the Prometheus source. The dashboard shows memory usage, command execution statistics, client connections, and persistence status.

4. Set Up Alerting – Define alert rules in Prometheus to detect abnormal Redis conditions, such as too many client connections:

groups:<br/>- name: redis_alerts<br/>  rules:<br/>  - alert: TooManyConnections  # alert name<br/>    expr: redis_connected_clients > 1000  # expression<br/>    for: 5m  # duration<br/>    labels:<br/>      severity: warning<br/>    annotations:<br/>      summary: "Too many connections (instance {{ $labels.instance }})"<br/>      description: "Redis instance has too many connections
  VALUE = {{ $value }}
  LABELS = {{ $labels }}"

This rule triggers a warning when the number of connected clients exceeds 1000 for five minutes, helping operators respond quickly.

By following these steps, you can achieve end‑to‑end monitoring of Redis, from metric collection to visualization and automated alerting.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

monitoringredisAlertingPrometheusGrafanaExporter
DevOps Operations Practice
Written by

DevOps Operations Practice

We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.