Introduction
Redis is a high-performance, in-memory data store commonly used as a database, cache, and message broker. Monitoring Redis is essential for tracking key performance metrics such as memory usage, latency, keyspace operations, and more.
To monitor Redis efficiently, we can use the OpenTelemetry Redis Receiver, which collects key Redis performance metrics.
Kubernetes 2.0 ConfigMap
Users should update or append the existing ConfigMap named opsramp-workload-metric-user-config by adding application-specific fields. These fields may include authentication credentials, collection frequency, and other relevant configurations.
apiVersion: v1
kind: ConfigMap
metadata:
  name: opsramp-workload-metric-user-config
  namespace: opsramp-agent
data:
  workloads: |
    redis:
      - name: redis
        auth: none
        port: 6379
        collectionFrequency: 2m
        targetPodSelector:
          matchLabels:
            - key: app
              operator: ==
              value:
                - redis
      - name: redis-with-tls
        auth: tls
        certFile:
          source: secret
          value: default/redis-tls-client/redis-client.crt
        keyFile:
          source: secret
          value: default/redis-tls-client/redis-client.key
        port: 6379
        collectionFrequency: 2m
        targetPodSelector:
          matchLabels:
            - key: app
              operator: ==
              value:
                - redis-tls
      - name: redis-with-credentials
        auth: credentials
        userName:
          source: value
          value: sri
        password:
          source: configmap
          value: default/redis-config/REDIS_PASSWORD
        port: 6379
        collectionFrequency: 2m
        targetPodSelector:
          matchLabels:
            - key: app
              operator: ==
              value:
                - redis-credsSupported Metrics
Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.
| Metric | Description | 
|---|---|
| redis_clients_blocked | Number of blocked Redis clients | 
| redis_clients_connected | Number of connected Redis clients | 
| redis_clients_max_input_buffer | Maximum input buffer size for Redis clients | 
| redis_clients_max_output_buffer | Maximum output buffer size for Redis clients | 
| redis_commands | Number of commands processed by Redis | 
| redis_commands_processed | Total number of commands processed by Redis | 
| redis_connections_received | Number of connections received by Redis | 
| redis_connections_rejected | Number of rejected connections in Redis | 
| redis_cpu_time | CPU time used by Redis | 
| redis_db_avg_ttl | Average time-to-live (TTL) of keys in Redis databases | 
| redis_db_expires | Number of keys with expiration set in Redis databases | 
| redis_db_keys | Number of keys in Redis databases | 
| redis_keys_evicted | Number of evicted keys in Redis | 
| redis_keys_expired | Number of expired keys in Redis | 
| redis_keyspace_hits | Number of successful key lookups in Redis | 
| redis_keyspace_misses | Number of failed key lookups in Redis | 
| redis_latest_fork | Time since the last Redis fork | 
| redis_memory_fragmentation_ratio | Memory fragmentation ratio in Redis | 
| redis_memory_lua | Memory used by Lua scripts in Redis | 
| redis_memory_peak | Peak memory usage in Redis | 
| redis_memory_rss | Redis memory usage in the system’s resident set size (RSS) | 
| redis_memory_used | Total memory used by Redis | 
| redis_net_input | Amount of data received by Redis over the network | 
| redis_net_output | Amount of data sent by Redis over the network | 
| redis_rdb_changes_since_last_save | Number of changes since the last RDB save operation | 
| redis_replication_backlog_first_byte_offset | First byte offset of the replication backlog in Redis | 
| redis_replication_offset | Replication offset in Redis | 
| redis_slaves_connected | Number of connected slaves in Redis replication | 
| redis_uptime | Uptime of the Redis server in seconds |