Redis is an in-memory key-value data store used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
The Redis monitoring extension can monitor multiple Redis servers and display the statistics in AppDynamics Metric Browser.
Configure the Redis monitoring extension by editing the config.yml file in
<MachineAgent_Dir>/monitors/The metricPrefix of the extension has to be configured as specified here. Please make sure that the right metricPrefix is chosen based on your machine agent deployment, otherwise this could lead to metrics not being visible in the controller.
Configure the Redis instances by specifying the name(required), host(required), port(required) of the Redis instance, password (only if authentication enabled), encryptedPassword(only if password encryption required).
#Add your list of Redis servers here. servers: - name: "Server1" host: "localhost" port: "6379" password: "" encryptedPassword: "" - name: "Server2" host: "localhost" port: "6380" password: "" encryptedPassword: ""
Configure the encyptionKey for encryptionPasswords(only if password encryption required).
#Encryption key for Encrypted password. encryptionKey: "axcdde43535hdhdgfiniyy576"
Configure the numberOfThreads(only if the number of Redis servers need to be monitored is greater than 7).
For example, If number Redis servers that need to be monitored is 10, then number of threads required is 10 * 3 = 30
Configure the metrics section.
For configuring the metrics, the following properties can be used:
|Property||Default value||Possible values||Description|
|alias||metric name||Any string||The substitute name to be used in the metric browser instead of metric name.|
|aggregationType||"AVERAGE"||"AVERAGE", "SUM", "OBSERVATION"||Aggregation qualifier|
|timeRollUpType||"AVERAGE"||"AVERAGE", "SUM", "CURRENT"||Time roll-up qualifier|
|clusterRollUpType||"INDIVIDUAL"||"INDIVIDUAL", "COLLECTIVE"||Cluster roll-up qualifier|
|multiplier||1||Any number||Value with which the metric needs to be multiplied.|
|convert||null||Any key value map||Set of key value pairs that indicates the value to which the metrics need to be transformed. eg: UP:0, DOWN:1|
|delta||false||true, false||If enabled, gives the delta values of metrics instead of actual values.|
- total_connections_received: #Total number of connections accepted by the server alias: "connectionsReceived" multiplier: 1 aggregationType: "SUM" timeRollUpType: "CURRENT" clusterRollUpType: "INDIVIDUAL" delta: true - role: #Role of Redis server(master or slave) convert: master: 1 slave: 0
**All these metric properties are optional, and the default value shown in the table is applied to the metric(if a property has not been specified) by default.**
To avoid setting the clear text password in the config.yml, please follow the steps below to encrypt the password and set the encrypted password and the key in the config.yml:
java -cp "redis-monitoring-extension.jar" com.appdynamics.extensions.crypto.Encryptor myKey myPasswordwhere "myKey" is any random key, "myPassword" is the actual password that needs to be encrypted
It is recommended that a single Redis monitoring extension be used to monitor multiple Redis servers belonging to a single cluster.
This extension uses INFO command to fetch metrics from Redis server. Some of the metrics are listed below:
This extension also uses SLOWLOG to fetch metrics from Redis server:
no_of_new_slow_logs: This metric represents the number of new logs that were
recorded as slowlogs(log queries that exceeded a specified execution time)
since the extension has recorded in its previous run. To use this metric, the "slowlog-log-slower-than" config parameter has to be
set for the Redis server.
In addition to the above metrics, there is a metric called "connectionStatus" with a value 0 when the connection to Redis server failed and 1 when the connection to the Redis server is successful.
Workbench is a feature by which you can preview the metrics before registering it with the controller. This is useful if you want to fine tune the configurations. Workbench is embedded into the extension jar. To use the workbench, follow all the steps in installation and configuration.
Start the workbench with the following command if you are in
java -jar /monitors/RedisMonitor/redis-monitoring-extension.jarThis starts an http server at http://localhost:9090/. This can be accessed from the browser.
If the server is not accessible from outside/browser, you can use the following end points to see the list of registered metrics and errors.
Get the stats curl http://localhost:9090/api/stats Get the registered metrics curl http://localhost:9090/api/metric-paths
Redis Version Tested On:
1.0.0 - Release version
1.0.1 - Code Optimization.
1.0.2 - Support for role metrics
1.0.3 - Revamped and Added more metrics.
1.0.4 - JDK 1.6 compatible
1.0.5 - Added commandstats and keyspace_hit_ratio
1.0.6 - Added code fixes
1.0.7 - Fix for includePatterns
2.0.0 - Revamped the extension to support new extensions framework(2.0.0), Added new metrics like "no_of_new_slow_logs", "connectionStatus
2.0.1 - Updated Licenses
2.0.2 - Fixed documenation bug in config.yml
3.0.1 - Updated to commons 2.2.4 and fixed issue for global encryptionKey and heartbeat metric
Always feel free to fork and contribute any changes directly via GitHub.
For any questions or feature request, please contact AppDynamics Support.
v3.0.1 - Updated to work with MachineAgent 21.x