monitoring_memcache
Adds Monitoring sensors that report on each configured Memcache cluster, so cache health can be alerted on alongside the rest of your site's sensors.
Sensors provided
One sensor instance is provisioned per configured cluster, for each of the following metrics:
- Memcache memory usage —
bytes / limit_maxbytesas a percentage. Default thresholds: warn at 80, critical at 95. - Memcache hit ratio —
get_hits / (get_hits + get_misses)as a percentage. Default thresholds: warn below 85, critical below 70. - Memcache evictions — cumulative evictions counter across the cluster.
- Memcache connectivity — number of reachable servers. Turns CRITICAL when fewer servers respond than are configured.
- Memcache uptime — minimum uptime across the cluster, in seconds. A drop indicates at least one server has restarted.
How it works
On install, the module reads $settings['memcache']['servers'], enumerates distinct cluster names, and creates one monitoring_sensor_config entity per (metric × cluster) pair. Each sensor's settings carry the cluster name, which the plugin passes to MemcacheDriverFactory::get() to retrieve stats at runtime. Existing sensor configs are preserved across re-provisioning, so admin edits to thresholds or labels are not clobbered.
The monitoring.settings:disable_sensor_autocreate toggle is honored: when enabled, the install hook creates no sensors, and the status report downgrades the "missing sensors" warning to informational.
A runtime requirements check surfaces two diagnostics on admin/reports/status:
- Clusters configured in memcache settings but not yet provisioned with sensors.
- Sensors referencing clusters that no longer exist in memcache settings.
To re-provision sensors after changing $settings['memcache'], either uninstall and re-enable the module, or call:
\Drupal::classResolver( \Drupal\monitoring_memcache\MemcacheClusterDiscovery::class )->ensureSensors();
Requirements
- Drupal 10.3+ or 11.x
- Monitoring
- Memcache — both the main module and the
memcache_adminsubmodule
Related projects
- Monitoring — the sensor framework this module plugs into.
- Memcache — provides the backend and the
memcache_adminstats surface.