stack_vitals
Stack Vitals brings the production health of the
infrastructure your Drupal site runs on into the Drupal admin, so you no
longer need shell access (or a separate monitoring stack) just to answer
"is the database under load?", "is the cache reachable?" or "is PHP-FPM
out of workers?". It collects key metrics from MariaDB/MySQL, Redis,
PHP-FPM and PHP OPcache, evaluates each against sensible thresholds, and
shows them as a single colour-coded report at
Reports → Stack Vitals. New to Drupal? Enable the module, turn
on the provider for the service you care about, and you immediately get a
plain-English health dashboard, no configuration required to start.
Features
- One admin dashboard summarising the health of every monitored
service, with an at-a-glance OK / Warning / Critical status per
provider and per metric, plus the rationale behind every threshold. - Pluggable VitalsProvider architecture: each service is a
separate submodule, and third parties can ship their own providers
(Solr, Varnish, queues, cron, …) without patching or forking. - Bundled providers:
- MariaDB / MySQL: threads connected/running,
slow queries, aborted connections, InnoDB buffer pool hit ratio,
long-running queries (uses the site's existing database
connection). - Redis : connection, ping latency, keyspace hit
ratio, memory vs maxmemory, evicted keys, connected clients. - PHP-FPM : active/idle workers, listen queue
depth, max-children-reached, slow requests (HTTP or socket). - OPcache : hit rate, memory pressure, cached-key
saturation, out-of-memory restarts.
- MariaDB / MySQL: threads connected/running,
- Trend history: numeric metrics are sampled over time and shown as
per-metric min / avg / max and an inline sparkline. - Results are cached briefly so dashboards never hammer the monitored
systems; a "Refresh now" action bypasses the cache on demand. - Site Status report integration via
hook_requirements(),
so existing uptime tooling that scrapes
/admin/reports/status picks up vitals automatically. - Drush:
drush stack-vitals:status(table / JSON / YAML)
anddrush stack-vitals:checkwith monitoring-friendly
exit codes for cron and CI alerting. - Read-only and access-controlled: it never tunes or writes to the
systems it inspects, and is never available anonymously.
Use it when you operate a Drupal site under real traffic and want
early warning of database saturation, cache problems or an undersized
PHP-FPM pool, surfaced where site administrators already work.
Post-Installation
- Enable the base Stack Vitals module and at least one
provider submodule (e.g. Stack Vitals: Redis). The base
module ships no providers itself, so you only install what you
need. - Visit Reports → Stack Vitals
(/admin/reports/stack-vitals). Providers that can
auto-discover their connection (for example MariaDB, which reuses the
site database) report immediately. - For providers that need connection details (Redis host/socket,
PHP-FPM status URL/socket), go to the Settings tab
(/admin/reports/stack-vitals/settings) and to each
provider's configuration. Thresholds have sensible defaults and are
fully overridable per metric. - Grant the View Stack Vitals report permission to the roles
that should see the dashboard. Administer Stack Vitals is a
sensitive permission (it controls provider connection targets) and
should be limited to trusted administrators. - Optional: enable trend history under Settings to start collecting
sparkline/min-avg-max data, and add
drush stack-vitals:checkto cron/CI for alerting.
No new content types, text formats or blocks are created - Stack
Vitals only adds an administrative report and configuration.
Additional Requirements
- Drupal 10.3+ or Drupal 11; PHP 8.1+.
- Drupal core only for the base module: no contributed dependencies.
- Provider-specific (only for the submodule you enable):
- MariaDB provider: a MariaDB/MySQL default database connection.
- Redis provider: the PHP
redisextension (declared
as a Composer suggestion, not a hard requirement, so the
base module installs cleanly without it; the provider reports
itself unavailable if the extension is missing). - PHP-FPM provider: PHP-FPM with
pm.status_path
enabled, reachable via an HTTP status URL or a FastCGI socket. - OPcache provider: the OPcache extension enabled in the PHP
process being measured.
Recommended modules/libraries
- Drush: optional but recommended; enables the
stack-vitals:statusandstack-vitals:check
commands for scripted monitoring and CI gates. - Any external monitoring/alerting stack (Prometheus, Nagios,
uptime checks): point it at the Status report or the Drush JSON
output to alert on degraded vitals.
Similar projects
Modules such as Monitoring, Health Check (Site Health), and various
Redis/Memcache admin modules expose individual signals or generic
checks. Stack Vitals differs by being a single, pluggable framework
focused specifically on the database / cache / runtime tier: every
metric carries an explicit OK/Warning/Critical threshold and a
human-readable rationale, results are normalised through one value
model (so the dashboard, Status report and Drush JSON are consistent),
and third parties can add providers without forking. It is intentionally
read-only and reporting-only - it observes the stack, it does not tune
it.
Supporting this Module
Issues, reviews and merge requests are very welcome via the project
issue queue. If you would like to sponsor a specific provider or
feature, please open an issue to discuss.
Community Documentation
See the README.md in the repository for architecture
details and a guide to writing your own provider. Additional
walkthroughs and a demo will be linked here as they become available.