Menu
Grafana Cloud

Redis integration for Grafana Cloud

Redis is an in-memory data structure store frequently used as a key-value data store, cache, and message broker.

This integration includes 6 useful alerts and 1 pre-built dashboard to help monitor and visualize Redis metrics.

Before you begin

A user must be created in Redis for Grafana Agent in order to connect to the cluster. We strongly recommend that you configure a separate user for the Agent, and give it only the strictly mandatory security privileges necessary for monitoring your node, as per the official documentation.

Install Redis integration for Grafana Cloud

  1. In your Grafana Cloud stack, click Connections in the left-hand menu.
  2. Find Redis and click its tile to open the integration.
  3. Review the prerequisites in the Configuration Details tab and set up Grafana Agent to send Redis metrics to your Grafana Cloud instance.
  4. Click Install to add this integration’s pre-built dashboard and alerts to your Grafana Cloud instance, and you can start monitoring your Redis setup.

Post-install configuration for the Redis integration

This integration is configured to work with the redis_exporter, which is embedded in Grafana Agent.

Enable the integration by manually adding the provided snippet to your agent configuration file.

Make sure to change the redis_addr to the addresses of the Redis server you want to monitor in the agent config.

For a full description of configuration options see how to configure the redis_exporter_config block in the agent documentation.

Configuration snippets for Grafana Agent

Below integrations, insert the following lines and change the URLs according to your environment:

yaml
  redis_exporter:
    enabled: true
    redis_addr: localhost:6379 # replace with your connection string
    instance: '<your-instance-name>'

Full example configuration for Grafana Agent

Refer to the following Grafana Agent configuration for a complete example that contains all the snippets used for the Redis integration. This example also includes metrics that are sent to monitor your Grafana Agent instance.

yaml
integrations:
  prometheus_remote_write:
  - basic_auth:
      password: <your_prom_pass>
      username: <your_prom_user>
    url: <your_prom_url>
  agent:
    enabled: true
    relabel_configs:
    - action: replace
      source_labels:
      - agent_hostname
      target_label: instance
    - action: replace
      target_label: job
      replacement: "integrations/agent-check"
    metric_relabel_configs:
    - action: keep
      regex: (prometheus_target_sync_length_seconds_sum|prometheus_target_scrapes_.*|prometheus_target_interval.*|prometheus_sd_discovered_targets|agent_build.*|agent_wal_samples_appended_total|process_start_time_seconds)
      source_labels:
      - __name__
  # Add here any snippet that belongs to the `integrations` section.
  # For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
  redis_exporter:
    enabled: true
    redis_addr: localhost:6379 # replace with your connection string
    instance: '<your-instance-name>'
logs:
  configs:
  - clients:
    - basic_auth:
        password: <your_loki_pass>
        username: <your_loki_user>
      url: <your_loki_url>
    name: integrations
    positions:
      filename: /tmp/positions.yaml
    scrape_configs:
      # Add here any snippet that belongs to the `logs.configs.scrape_configs` section.
      # For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
metrics:
  configs:
  - name: integrations
    remote_write:
    - basic_auth:
        password: <your_prom_pass>
        username: <your_prom_user>
      url: <your_prom_url>
    scrape_configs:
      # Add here any snippet that belongs to the `metrics.configs.scrape_configs` section.
      # For a correct indentation, paste snippets copied from Grafana Cloud at the beginning of the line.
  global:
    scrape_interval: 60s
  wal_directory: /tmp/grafana-agent-wal

Dashboards

The Redis integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.

  • Redis Dashboard for Prometheus Redis Exporter 1.x

Overview

Overview

Alerts

The Redis integration includes the following useful alerts:

AlertDescription
RedisDownCritical: Redis down (instance {{ $labels.instance }})
RedisOutOfMemoryWarning: Redis out of memory (instance {{ $labels.instance }})
RedisTooManyConnectionsWarning: Redis too many connections (instance {{ $labels.instance }})
RedisClusterSlotFailWarning: Number of hash slots mapping to a node in FAIL state (instance {{ $labels.instance }})
RedisClusterSlotPfailWarning: Number of hash slots mapping to a node in PFAIL state (instance {{ $labels.instance }})
RedisClusterStateNotOkCritical: Redis cluster state is not ok (instance {{ $labels.instance }})

Metrics

The most important metrics provided by the Redis integration, which are used on the pre-built dashboard and Prometheus alerts, are as follows:

  • redis_blocked_clients
  • redis_cluster_slots_fail
  • redis_cluster_slots_pfail
  • redis_cluster_state
  • redis_commands_duration_seconds_total
  • redis_commands_total
  • redis_connected_clients
  • redis_connected_slaves
  • redis_db_keys
  • redis_db_keys_expiring
  • redis_evicted_keys_total
  • redis_keyspace_hits_total
  • redis_keyspace_misses_total
  • redis_master_last_io_seconds_ago
  • redis_memory_fragmentation_ratio
  • redis_memory_max_bytes
  • redis_memory_used_bytes
  • redis_memory_used_rss_bytes
  • redis_total_system_memory_bytes
  • redis_up

Changelog

md
# 0.0.6 - November 2023

* Replaced Angular dashboard panels with React panels

# 0.0.5 - July 2023

* New Filter Metrics option for configuring the Grafana Agent, which saves on metrics cost by dropping any metric not used by this integration. Beware that anything custom built using metrics that are not on the snippet will stop working.
* New hostname relabel option, which applies the instance name you write on the text box to the Grafana Agent configuration snippets, making it easier and less error prone to configure this mandatory label.

# 0.0.4 - May 2023

* Update mixin to latest version:
  - Add RedisClusterSlot alerts
  
# 0.0.3 - May 2022

* Update mixin to latest version:
  - Fix selector

# 0.0.2 - October 2021

* Update mixin to latest version:
  - Update queries to use $__rate_interval

# 0.0.1 - October 2020

* Initial release

Cost

By connecting your Redis instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see Active series and dpm usage and Cloud tier pricing.