Monitor Redis Sentinel
Overview
Redis Sentinel on Instances is monitored using sfAgent Configured with Redisdb Plugin. When Sentinel is Configured.
Redis sentinel plugin was tested with 6.2.6 and 5.0.7 sentinel versions with ubuntu 20.04.4 LTS.
The configurations given below apply only to the Redis Sentinel setup on an instance.
Metrics plugin
Collects metric data organized in following documentType
under metrics index:
- redisDetails
- redisStat
- redisPersistence
- masterReplication
- slaveReplication
Logger plugin
Collects general logs and slow query logs. General logs are sent to log index whereas slow queries are sent to metrics index under documentType:redisSlowLogs
Pre-requisites
Enable Slow Logs
In redis.cnf
file, uncomment and configure the variables shown below:
slowlog-log-slower-than= 1
slowlog-max-len=100
Or, login to redis with root user and execute below commands
config set slowlog-log-slower-than= 1;
config set slowlog-max-len=100;
Configuration
Refer to sfAgent to install and automatically generate plugin configurations. User can also manually add the configuration shown below to config.yaml
under /opt/sfagent/directory
Metrics:
plugins:
- name: redisdb
enabled: true
interval: 60
config:
documentsTypes:
- keyspaceStat
- redisDetails
- redisPersistence
- redisStat
- slowLogs
- masterReplication
- slaveReplication
password: < password >
port: 6379
user: < username >
sentinelIp: < Ipaddress >
sentinelPort: 26379
sentinelMaster: < Mastername >
logging:
plugins:
- name: redis-sentinel
enabled: true
config:
log_path: /var/log/redis/sentinel.log
Viewing data and dashboards
- Data generated by plugin can be viewed in
browse data
page inside the respective application underplugin=redisdb
anddocumentType=serverDetails
- Dashboard for this data can be instantiated by Importing dashboard template
RedisReplication
to the application dashboard.