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-creds

Supported Metrics

Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.

MetricDescription
redis_clients_blockedNumber of blocked Redis clients
redis_clients_connectedNumber of connected Redis clients
redis_clients_max_input_bufferMaximum input buffer size for Redis clients
redis_clients_max_output_bufferMaximum output buffer size for Redis clients
redis_commandsNumber of commands processed by Redis
redis_commands_processedTotal number of commands processed by Redis
redis_connections_receivedNumber of connections received by Redis
redis_connections_rejectedNumber of rejected connections in Redis
redis_cpu_timeCPU time used by Redis
redis_db_avg_ttlAverage time-to-live (TTL) of keys in Redis databases
redis_db_expiresNumber of keys with expiration set in Redis databases
redis_db_keysNumber of keys in Redis databases
redis_keys_evictedNumber of evicted keys in Redis
redis_keys_expiredNumber of expired keys in Redis
redis_keyspace_hitsNumber of successful key lookups in Redis
redis_keyspace_missesNumber of failed key lookups in Redis
redis_latest_forkTime since the last Redis fork
redis_memory_fragmentation_ratioMemory fragmentation ratio in Redis
redis_memory_luaMemory used by Lua scripts in Redis
redis_memory_peakPeak memory usage in Redis
redis_memory_rssRedis memory usage in the system’s resident set size (RSS)
redis_memory_usedTotal memory used by Redis
redis_net_inputAmount of data received by Redis over the network
redis_net_outputAmount of data sent by Redis over the network
redis_rdb_changes_since_last_saveNumber of changes since the last RDB save operation
redis_replication_backlog_first_byte_offsetFirst byte offset of the replication backlog in Redis
redis_replication_offsetReplication offset in Redis
redis_slaves_connectedNumber of connected slaves in Redis replication
redis_uptimeUptime of the Redis server in seconds