Overview


Information in this article is related to using CloudMonix for monitoring Redis cache.


The article covers the following topics:

  • common use cases where CloudMonix can help with monitoring and automation

  • what happens in the monitoring cycle

  • what is needed to connect to and monitor Redis cache

  • what metrics can be tracked, visualized and monitored

  • what automated actions can be executed by CloudMonix

CloudMonix allows for monitoring both managed Azure Redis Cache service and a standalone Redis cache deployed on any internet accessible machine. There are some differences between default templates for Azure Redis Cache and standalone installation. See Metrics section to learn more.


Why use CloudMonix for Redis?

Popular usages of CloudMonix include the following examples:

  • Monitoring Uptime and Availability

  • Monitoring cache hits and misses

  • Alerting on outages, high server load and CPU utilization


Monitoring Cycle

The monitoring cycle length is 10 min. by default in the Free Plan, and 1 min. in the Professional and Ultimate Plans.


In every monitoring cycle CloudMonix will capture metrics data by querying Redis directly or using Azure Insights API. In each cycle CloudMonix will cache some data and then ask Redis to give it back, to ensure the service is functioning correctly.


After each monitored cycle is completed, CloudMonix will evaluate and possibly execute any automated actions.


Configuration


Redis monitoring can be configured either via Setup Wizard or by using the “Add New” button in the dashboard. It’s highly recommended to use Setup Wizard when configuring permissions for the first time, as that will simplify authorization. Learn more about authorizing with Setup Wizard here.


Metrics


Every diagnostic data point that CloudMonix retrieves from the monitored resource is considered a metric in CloudMonix. Refer to the Metrics article to learn more about metrics in general.


CloudMonix retrieves most metrics directly using Redis client, for Azure Redis Cache additional metrics are captured using Applications.Insights API.


CloudMonix provides two default templates for monitoring Redis:

  • Sample configuration for Azure Redis Cache

  • Sample configuration for Redis Cache (standalone)

 

The metrics can be added, removed and customized in the Metrics tab in the resource configuration dialog.


Built-in Metrics

ResourceStatus

Identifies the last state of the monitored resource. This is a critical metric that is captured for most types of resources that CloudMonix tracks. It is used for Uptime reports and should not be removed.

  • Available for Azure Redis Cache and standalone.

  • Data Type: string

  • Possible values: Ready, Down, Unknown

  • Included in sample profile: yes, tracked in both templates as a metric called Status

  • Included in default alerts: yes, in both templates as an alert called ResourceOutage (Error) Status other than Ready sustained for at least 2 min.

Statuses are determined according to the following rules:


  • Ready - successfully connected to the resource

  • Down - there was an error when trying to retrieve data from the resource

  • Unknown - can’t connect to the resource (e.g. because of invalid credentials)


ResponseTime

Tracks the time in milliseconds to connect to the resource using PING command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: double

  • Included in sample profile: no

  • Included in default alerts: no


AzureRedisCacheMetric

Tracks number of commands processed (get, set) aggregated over 5 min. time windows. Retrieved using Azure Insights API.

The available metrics are listed in the Available metrics and reporting intervals section in this MSDN article. CloudMonix metric has the format AzureMetricName_int_Min, e.g. Gets5Min or TotalOperations5Min. The 5 min. Interval is minimum granularity for obtaining the value, as provided by Azure.

Values can be also aggregated over longer windows using Expressions, as described in the Working with Expressions article in Evaluating data in sets\arrays (advanced) section.

  • Available only for Azure Redis Cache.

  • Data Type: double

  • Included in sample profile: yes, tracked as metrics:

    • EvictedKeys5Min: The number of items evicted from the cache during the 5 min. reporting interval due to the maxmemory limit. This value maps to the Redis INFO evicted_keys command.

    • Gets5Min: The number of get operations from the cache during 5min interval. This value is the sum of the following values from the Redis INFO all command: cmdstat_getcmdstat_hgetcmdstat_hgetallcmdstat_hmgetcmdstat_mgetcmdstat_getbit, and cmdstat_getrange, and is equivalent to the sum of cache hits and misses during the 5 min. interval.

    • Sets5Min: The number of set operations to the cache during 5 min. interval. This value is the sum of the following values from the Redis INFO all command: cmdstat_setcmdstat_hsetcmdstat_hmsetcmdstat_hsetnx, cmdstat_lset, cmdstat_mset, cmdstat_msetnx, cmdstat_setbit, cmdstat_setex, cmdstat_setrange and cmdstat_setnx.

    • TotalOperations5Min: The total number of commands processed by the cache server during 5 min. reporting interval. This value maps to the Redis INFO total_commands_processed command.

  • Included in default alerts: no



AzureRedisCacheOperations

Tracks management operations to Azure Redis Cache. Retrieved using ListEvents method exposed by Azure Insights API.

  • Available only for Azure Redis Cache.

  • Data Type: object with the following properties:

  • Name (string): Operation name

  • Category (string): Event category

  • Description (string): Event description

  • Caller (string): Caller

  • EventName (string): The event name.This value should not be confused with operation name

  • Level (string): Event level

  • Status (string): The event status. Possible values include: Started, Succeeded, Failed

  • SubStatus (string): The event sub status. Most of the time, when included, this captures the HTTP status code

  • ExtendedInfo (string):The values of all properties of the EventData object displayed as Key-Value pairs, where keys are property names

  • EventTimestamp (DateTime): The occurrence time of event

  • Included in sample profile: yes, tracked as a metric called ManagementOperations

  • Included in default alerts: no


RedisCacheClients

The number of client connections to the cache. This value maps to Redis INFO clients command.

The connected clients limit is 10 000. If that limit is reached then connection attempts to the cache fail. The value excludes connections from slaves.

  • Available for Azure Redis Cache and standalone.

  • Requires specifying Metric Definition, i.e. selecting field that will be tracked for this metric such as connected_clients or blocked_clients.

  • Data Type: double

  • Included in sample profile: yes, tracked in both templates as a metric called ConnectedClients

  • Included in default alerts: yes, in an alert called Too many Connected Clients (Warning): Raises an alert as number of connected clients is approaching Azure's limit of 10000.


RedisCacheCpuUtilization

The CPU utilization of the Azure Redis Cache server as a percentage during the specified reporting interval. This value maps to the operating system \Processor(_Total)\% Processor Time performance counter.

  • Available for Azure Redis Cache and standalone.

  • Requires specifying Metric Definition, i.e. selecting field that will be tracked for this metric such as used_cpu_sys or used_cpu_sys_children.

  • Data Type: double

  • Included in sample profile: yes, tracked in all profiles as a metric called ServerLoad

  • Included in default alerts: yes, in both templates as an alert called High Server Load (Warning): Server load (CPU utilization) is greater than 80% for a sustained amount of time



RedisCacheHitRate

Measures the hit rate (effectiveness) of cache. Calculated according to the formula: (100* keyspace_hits)/(keyspaceHits + keyspaceMisses). The keyspaceHits and keyspaceMisses values map to the keyspace_hits and keyspace_misses returned by Redis INFO stats command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: double

  • Included in sample profile: yes, tracked in both templates as a metric called HitRate

  • Included in default alerts: no


RedisCacheInfo

Tracks information returned by Redis INFO command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: string

  • Included in sample profile: yes, tracked as a metric called INFO, but needs to be explicitly enabled

  • Included in default alerts: no

RedisCacheKeyList

Tracks statistical information about Redis databases. This value maps to Redis INFO keyspace command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: object with the following properties:

  • Database (string): database name (dbXXX)

  • Keys (int): number of keys (keys=XXX)

  • KeysWithExpiration (int) number of expired keys (expires=XXX)

  • AverageTtlInMs (int): average age of expired keys (avg_ttl=XXX)

  • Included in sample profile: yes, tracked in both templates as a metric called KeyStatistics

  • Included in default alerts: no


RedisCacheMemoryFragmentationRatio

Tracks the ratio of the used memory to the total available memory. Calculated according to the formula used_memory_rss/used_memory. The used_memory_rss and used_memory values are returned by Redis INFO memory command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: double

  • Included in sample profile: no

  • Included in default alerts: no


RedisCacheMemoryUtilization

Tracks amount of used memory by the cache. This value maps to Redis INFO memory command.

  • Available for Azure Redis Cache and standalone.

  • Requires specifying Metric Definition, i.e. selecting field that will be tracked for this metric such as used_memory or used_memory_lua.

  • Data Type: double

  • Included in sample profile: yes, tracked in all templates as a metric called UsedMemory

  • Included in default alerts: no


RedisCacheReplication

Tracks information on master/slave replication. This value maps to Redis INFO replication command.

  • Available for Azure Redis Cache and standalone.

  • Requires specifying Metric Definition, i.e. selecting field that will be tracked for this metric such as master_last_io_seconds_ago or master_sync_last_io_seconds_ago.

  • Data Type: double

  • Included in sample profile: no

  • Included in default alerts: no


RedisCacheScript

Tracks values returned by a custom Lua script. Executed using ScriptEvaluate command.

  • Available for Azure Redis Cache and standalone.

  • Data Type: string

  • Included in sample profile: no

  • Included in default alerts: no


RedisCacheSlaveList

Tracks basic sync information for Redis slave servers. This value maps to Redis INFO keyspace command for nodes which role is slave.

  • Available for Azure Redis Cache and standalone.

  • Data Type: object with the following properties:

  • Name (string):

  • Host (string)

  • State (string)

  • Offset (int)

  • Lag (int)

  • Included in sample profile: yes, tracked in both templates as a metric called Slaves

  • Included in default alerts: no


RedisCacheStatistics

Tracks general statistics. This value maps to Redis INFO stats command.

  • Available for Azure Redis Cache and standalone.

  • Requires specifying Metric Definition, i.e. selecting field that will be tracked for this metric such as total_connections_received or pubsub_channels.

  • Data Type: double

  • Included in sample profile: no

  • Included in default alerts: no


Alerts


Users can create alerts based on changes in any value tracked by CloudMonix (including custom metrics). Each resource template includes alerts which are suitable for a given resource. The predefined alerts for Azure Redis Cache are listed in the Metrics section. Refer to the Alerts article to learn more about alerts in general.


Alerts are available during the Trial period or in Professional and Ultimate plans only.


Actions


Automation features (Actions) allow users to set up powerful reactive, proactive and scheduled actions. CloudMonix can execute a an automated action when a specific monitoring condition occurs or according to a schedule.


CloudMonix allows for executing Lua scripts directly on Redis. Lua can be used to optimize operations by executing them on the server. For example it might be used in secondary indexing for performing atomic updates (e.g. when creating an index based on complex criteria such as element frequency). Learn more about Lua scripting language for Redis.



 


Actions are available during the Trial period or in the Ultimate plan only.