content_telemetry
Content Telemetry & Performance Insights (CTPI)
CTPI is a production-grade, privacy-safe performance telemetry and insight engine for Drupal 10 and 11. It captures
request-level render metrics, aggregates them safely via cron, and delivers deterministic performance insights at
the entity, route, view, and block levels — directly inside the Drupal admin UI, with no external services and no
PII collected.
🎯 Why CTPI?
Traditional profiling tools are reactive and manual. CTPI provides continuous, structured telemetry and automated
insight generation inside Drupal.
- Detect slow database-heavy pages
- Identify cache inefficiencies
- Track render regressions against a 7-day baseline
- Surface block-level performance bottlenecks
- Enforce SLO-style render time budgets with automatic alerting
- Monitor site-wide health at a glance from the dashboard
🏗 Core Capabilities
- Request sampling control (configurable 0–100%)
- Hourly and daily rollup aggregation (idempotent, late-write safe)
- Aggregate-first reporting model
- Deterministic rule-based insight engine with configurable thresholds
- Entity health scoring (0–100) with colour-coded badges
- Trend analysis with pill-style Rising / Stable / Critical indicators
- Inline SVG sparkline performance visualizations (no external JS)
- JSON Insight API for external integrations
🧠 Insight Engine
CTPI includes a rule-based engine that evaluates performance context and produces structured, sortable insights with
severity classification (good, warn, poor). Every insight carries a numeric score; entity
and site-wide health scores (0–100) are derived automatically and displayed as colour-coded badges throughout the
UI.
Rules included out of the box:
- High DB Ratio — flags pages where database time dominates render time
- Low Cache Hit — flags when cache hit ratio falls below threshold
- Regression — flags when 24h average render exceeds the 7-day baseline
- Heavy Block Dominance — flags when a single block dominates render time
- Global Slow Block — flags a block that is slow across multiple entities
- Performance Budget — flags entities exceeding the configured render time budget
All rule thresholds (render budget, DB ratio, cache-hit ratio, regression %) are configurable at
admin/config/system/content-telemetry. The engine is fully typed, memoized, and deterministic.
🛡 Engineering Quality
- Strict typing & array-shape contracts throughout
- PHPStan Level 6 clean
- PHPUnit 11 compatible — 0 deprecation warnings
-
122 tests / 282 assertions covering event subscribers, form validation, controllers, all
insight rules, services, and a full kernel-level aggregation flow - GitLab CI pipeline (Drupal.org standard) — PHPUnit, PHPStan, and PHPCS run on every push
- Insert-only telemetry model — no schema mutations after install
- Drupal 10 and 11 compatible
📈 Roadmap
-
Drush CLI commands (
ctpi:report,ctpi:rollup,ctpi:health) for terminal
and CI use - Email / Slack alerts when health score drops or a regression is detected
- Watchdog integration — surface poor insights in Drupal's existing log UI
- Volatility detection and anomaly scoring
- Before/after performance snapshots with deployment markers
- CSV / JSON data export
- Views field integration — health badge inline on content listing pages
- Config split support for per-environment thresholds
CTPI is designed for enterprise Drupal installations that require continuous, structured performance intelligence
without external dependencies.