Drupal is a registered trademark of Dries Buytaert
drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)!

request_audit

No security coverage
View on drupal.org
Request Audit (request_audit)

Allow collect telemetry data from requests.

Overview

request_audit instruments incoming requests in Drupal and records latency telemetry. It can log request timing data either to Watchdog or to database tables for reporting and chart visualization.

The module provides:

  • An admin settings form to enable/disable telemetry and select logging destination.
  • A charts page that renders latency over time buckets (via Chart.js).
  • An AJAX endpoint that returns bucketed latency series data.
  • A “Top 10 slow URLs” table computed from recent aggregated buckets.

Requirements

  • Drupal 10 (and core versions compatible with what’s declared in composer.json)
  • PHP requirements are inherited from Drupal.
  • A database supported by Drupal’s database layer.

Dependencies

In composer.json the module requires:

  • drupal/core (^10.6 || ^11 || ^12)
  • npm-asset/chart.js (^4.4)

Installation

Install via Composer (recommended for contributed modules):

  1. From your Drupal root, require the module package:

    composer require drupal/request_audit

  2. Enable the module:

  • Via UI: Extend
  • Or with Drush:

    drush en request_audit

Run database updates if needed (Drupal will execute the install hook on enable):

drush updb

When enabled, the module’s request_audit.install will create these tables if they do not exist:

  • request_audit_rel
  • request_audit_latency_agg

Configuration

Go to:

  • Configuration → System → Request audit settings
    • Route: /admin/config/system/settings (request_audit.settings)

Settings:

  • Log activity (active)
  • Database
    • Log database activity (database_log)
    • Log queries list (save_queries)
  • Log destination (log_to)
    • watchdog: logs the payload to Drupal logger
    • database: stores request timing + aggregated latency in DB

Admin permission

All admin routes require:

  • administer site configuration

Charts / Reporting

Go to:

  • Reports → Request Audit Charts
    • Route: /admin/reports/request-audit-charts (request_audit.request_audit_charts)

The page includes:

  • A URL pattern control (glob-like, e.g. /pay2/*)
  • A time window selector
  • An auto-refreshing Chart.js chart
  • A “Top 10 slow URLs” section (based on average latency in recent buckets)

AJAX endpoint (data provider)

The chart fetches data from:

  • /admin/reports/request-audit-charts/block (request_audit.request_audit_charts_block)

Query parameters:

  • path (optional): exact path match
  • pattern (optional): glob-like pattern (e.g. /pay2/*)
  • windowMinutes (optional, default: 180)
  • bucketMinutes (optional, default: 5)

If neither path nor pattern is provided, it falls back to a top selection.

Data Model

request_audit_rel (per-request)

Created by request_audit.install and filled when logging to database is enabled.

Stores:

  • request_id, path, method
  • timing breakdown in milliseconds:
    • total_ms, routing_ms, controller_ms, render_ms, untracked_ms
  • DB timing breakdown:
    • db_total_ms, db_select_ms, db_write_ms
  • timestamp

request_audit_latency_agg (aggregated)

Stores aggregated latency per:

  • path
  • bucket_start / bucket_end (UTC buckets)

Fields include:

  • request_count
  • sum_latency_ms
  • avg_latency_ms
  • errors

Bucketing is done in the event subscriber with 5-minute UTC buckets.

Architecture Notes

Core logic lives in:

  • Drupal\request_audit\EventSubscriber\RequestTimingSubscriber

It subscribes to Kernel events:

  • REQUEST, CONTROLLER, VIEW, RESPONSE, TERMINATE

Key behaviors:

  • Generates a request id from X-Request-Id or via random_bytes().
  • When enabled and database_log is checked, starts Drupal DB query logging using Database::startLog().
  • On terminate:
    • analyzes logged queries
    • stores per-request data into request_audit_rel
    • updates aggregated bucket rows in request_audit_latency_agg

The chart UI JS lives in:

  • js/request_audit_charts.js

    and is declared in:
  • request_audit.libraries.yml

    (including Chart.js distribution from the npm asset).

Uninstallation

On module uninstall, request_audit_uninstall() drops:

  • request_audit_rel
  • request_audit_latency_agg

Activity

Total releases
3
First release
Jun 2026
Latest release
11 hours ago
Release cadence
0 days
Stability
67% stable

Release Timeline

Releases

Version Type Release date
1.0.1 Stable Jun 18, 2026
1.0.x-dev Dev Jun 18, 2026
1.0.0 Stable Jun 18, 2026