Redis is an in-memory data structure implementing a distributed, in-memory key-value database with optional durability.
The Sumo Logic app for Redis helps you monitor the state of the database cluster. The preconfigured dashboards provide information about cluster status, resource usage, commands running, and cache hit rate. You can easily determine the health of the cluster by just a glance at the dashboards.
## Log and Metrics types
This Sumo Logic app for Redis supports Metrics and Logs for Redis in Cluster or Standalone mode. The Redis logs are generated in files as configured in the cluster node configuration files in /etc/redis/redis.conf. For more details on Redis logs, [click here](https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-1-logging-to-redis/).
The app supports metrics generated by the [Redis plugin for Telegraf](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/redis) and assumes prometheus format metrics.
### Sample log messages
The first service in the metrics pipeline is Telegraf. Telegraf collects metrics from Redis. Note that we’re running Telegraf in each pod we want to collect metrics from as a sidecar deployment: that is, Telegraf runs in the same pod as the containers it monitors. Telegraf uses the Redis input plugin to obtain metrics. (For simplicity, the diagram doesn’t show the input plugins.) The injection of the Telegraf sidecar container is done by the Telegraf Operator.
Prometheus pulls metrics from Telegraf and sends them to [Sumo Logic Distribution for OpenTelemetry Collector](https://github.com/SumoLogic/sumologic-otel-collector) which enriches metadata and sends metrics to Sumo Logic.
In the logs pipeline, Sumo Logic Distribution for OpenTelemetry Collector collects logs written to standard out and forwards them to another instance of Sumo Logic Distribution for OpenTelemetry Collector, which enriches metadata and sends logs to Sumo Logic.
#### Configure Metrics Collection
:::note prerequisites
Ensure that you are monitoring your Kubernetes clusters with the Telegraf operator. If you are not, then follow [these instructions](/docs/send-data/collect-from-other-data-sources/collect-metrics-telegraf/install-telegraf) to do so.
:::
1. To collect metrics from a Kubernetes environment, add the following annotations on your Redis pods:
```sql
annotations:
telegraf.influxdata.com/class: sumologic-prometheus
prometheus.io/scrape: "true"
prometheus.io/port: "9273"
telegraf.influxdata.com/inputs: |+
servers = ["tcp://:
This section provides instructions for configuring metrics collection for the Sumo Logic app for Redis. Follow the instructions below to set up metrics and logs collection for a given Redis cluster:
#### Configure Metrics Collection
1. Configure a Hosted Collector. To create a new Sumo Logic hosted collector, perform the steps in the [Configure a Hosted Collector](/docs/send-data/hosted-collectors/configure-hosted-collector) section of the Sumo Logic documentation.
2. Configure an HTTP Logs and Metrics Source. Create a new HTTP Logs and Metrics Source in the hosted collector created above by following[ these instructions](/docs/send-data/hosted-collectors/http-source/logs-metrics). Make a note of the **HTTP Source URL**.
3. Install Telegraf. Follow the steps in [this document ](/docs/send-data/collect-from-other-data-sources/collect-metrics-telegraf/install-telegraf.md)Use the [in this document following steps](/docs/send-data/collect-from-other-data-sources/collect-metrics-telegraf/install-telegraf.md) to install Telegraf.
4. Configure and start Telegraf. As part of collecting metrics data from Telegraf, we will use the [Redis input plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/redis) to get data from Telegraf and the [Sumo Logic output plugin](https://github.com/SumoLogic/fluentd-output-sumologic) to send data to Sumo Logic.
1. Create or modify the telegraf.conf file and copy and paste the text below:
```sql
[[inputs.redis]]
servers = ["tcp://localhost:6379"]
namepass = ["redis"]
fieldpass = ["blocked_clients", "clients", "cluster_enabled", "cmdstat_calls", "connected_slaves", "evicted_keys", "expired_keys", "instantaneous_ops_per_sec", "keyspace_hitrate", "keyspace_hits", "keyspace_misses", "master_repl_offset", "maxmemory", "mem_fragmentation_bytes", "mem_fragmentation_ratio", "rdb_changes_since_last_save", "rejected_connections", "slave_repl_offset", "total_commands_processed", "total_net_input_bytes", "total_net_output_bytes", "tracking_total_keys", "uptime", "used_cpu_sys", "used_cpu_user", "used_memory", "used_memory_overhead", "used_memory_rss", "used_memory_startup"]
[inputs.redis.tags]
environment = "ENV_TO_BE_CHANGED"
component ="database"
db_system ="redis"
db_cluster: "ENV_TO_BE_CHANGED"
db_cluster_address = "ENV_TO_BE_CHANGED"
db_cluster_port = "ENV_TO_BE_CHANGED"
[[outputs.sumologic]]
url = "
### Cluster Overview
The **Redis - Cluster Overview** dashboard provides a high-level view of cluster infrastructure, comparisons, and trends.
Use this dashboard to:
* Review Cluster infrastructure.
* Manage Redis versions running on nodes.
* Understand Master and Slave replication offsets.
### Cluster Operations
The **Redis - Cluster Operations** dashboard provides a high-level view of the activity and health of Master and Slaves on your network. Dashboard panels display visual graphs and detailed information on replication offsets, cache rate, and most importantly, resource usage.
Use this dashboard to:
* To understand the Cluster resource usage.
* Gain insights into cache hit and miss rates.
### Logs
The **Redis - Logs** dashboard provides a detailed analysis based on logs. The panels provide details such as RDBMemory Usage, events, RDB, and AOF events.
Use this dashboard to:
* Review errors and warnings generated by the server.
* Review the RDBMemory Usage, events, RDB and AOF events.
### Command Stats Deltas
The **Redis - Command Stats Deltas** dashboard provides an at-a-glance view of commands running on your Redis server.
Use this dashboard to:
* To gain insights into the commands running on your cluster.
## Create monitors for Redis app
import CreateMonitors from '../../reuse/apps/create-monitors.md';
| Alert Name | Alert Description and conditions | Alert Condition | Recover Condition |
| Redis - Instance Down | This alert fires when we detect that the Redis instance is down for 5 minutes. | == 0 | >0 |
| Redis - Missing Master | This alert fires when we detect that a Redis cluster has no node marked as master for 5 minutes. | <=0 | >0 |
| Redis - Replication Broken | This alert fires when we detect that a Redis instance has lost a slave. | <0 | >=0 |
| Redis - Too Many Connections | This alert fires when we detect a given Redis server has too many connections (over 100). | >100 | <=100 |
| Redis - Rejected Connections | This alert fires when we detect that some connections to a Redis cluster have been rejected. | >0 | <=0 |
| Redis - High Memory Fragmentation Ratio | This alert fires when the ratio of Redis memory usage to Linux virtual memory pages (mapped to physical memory chunks) is higher than 1.5.
A high ratio will lead to swapping and can adversely affect performance. |
>=1.5 | <1.5 |
| Redis - Potential Master-Slave Communication Failure | This alert fires when we detect that communication between the Redis master and slave nodes has not occurred for the past 60 seconds or more. | >=60 | <60 |
| Redis - Replica Lag | This alert fires when we detect that the replica lag for a given Redis cluster is greater than 60 seconds. Please review how replication has been configured. | >60 | <=60 |
| Redis - Replication Broken | This alert fires when we detect that a Redis instance has lost all slaves. This will affect the redundancy of data stored in Redis. Please review how replication has been configured. | <0 | >=0 |
| Redis - Replication Offset | This alert fires when the replication offset in a given Redis cluster is greater than 1 MB for the last five minutes. Please review how replication has been configured. | >=1 | <1 |
| Redis - Out of Memory | This alert fires when we detect that a Redis node is running out of memory (> 90%). | > 90% | < 90% |
| Redis - High CPU Usage | This alert is fired if user and system cpu usage for a host exceeds 80%. | > 80% | < 80% |