Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Facets 3.0.7 Minor update available for module facets (3.0.7). Release: Superfish Dropdown Menu 8.x-1.16 Minor update available for module superfish (8.x-1.16). Release: Horizon Aid theme 1.0.0 Initial release available for theme vartheme_bs5_horizonaid (1.0.0)! Release: Vartheme Bs5 5.0.1 Minor update available for theme vartheme_bs5 (5.0.1). Release: Varbase AI Figma 1.0.2 Minor update available for module varbase_ai_figma (1.0.2). Release: AI Figma 1.0.1 Minor update available for module ai_figma (1.0.1). Release: Varbase AI Figma 1.0.1 Minor update available for module varbase_ai_figma (1.0.1). Release: Mapy.com 1.1.4 Minor update available for module mapycom (1.1.4). Usage Milestone: Shortcode Module shortcode crossed 1,000 active installs. Module Revived: PDF using mPDF 3.0.1 Module pdf_using_mpdf updated after 13 months of inactivity (3.0.1).

AI DB Observability Recipe

No security coverage

Part of the AI ecosystem · 298 projects

View on drupal.org

AI observability with Views is a Drupal recipe that stores Drupal AI provider events in your SQL database and gives you a searchable event log and four usage charts, all built as editable Views under /admin/reports/ai-requests.

What you get after applying

A Reports menu entry named AI requests with a paginated event log, an event detail page showing the captured prompt and response, and bar charts for requests per day, requests per model, tokens per model and tokens per day. Every page is a Views display you can change at /admin/structure/views.

Features

  • Event log: one row per provider lifecycle event (request started, response received, streaming response received, provider disabled) with filters for UTC date prefix, provider, model, operation, user ID, event name and request ID. The request ID links the start and completion events of a single call.
  • Event detail: time, provider, model, operation, user, reported tokens, request ID, the captured prompt and response text, provider configuration, tags and the token usage breakdown (input, output, reasoning, cached).
  • AI request volume: requests started per UTC day.
  • AI requests by model: requests started per provider and model.
  • AI tokens by model: reported total tokens per provider and model.
  • AI token trend: reported total tokens per UTC day.
  • Data tables under every chart: the numbers behind each chart are rendered as a table, so the reports work without JavaScript and with screen readers.
  • Shared filters on charts: date prefix, provider, model and operation filters narrow every chart.
  • Plain SQL storage: events are written by the AI Observability submodule through Logger and Logger DB. No external service, agent or OpenTelemetry collector is required.

How counting works

The log lists events, not requests. Request charts count only request-start events. Token charts sum the total token usage reported on completion and streaming completion events. Missing usage is left out rather than estimated as zero. Day buckets use UTC and days without events are omitted. Provider-disabled events never count as requests.

Coverage is limited to calls that go through the Drupal AI provider layer. Calls made directly through a vendor SDK are invisible. Failed or abandoned calls can leave a start event without a completion. The recipe does not report latency, error rates or monetary cost, because the AI Observability module does not record that data.

Recipe inputs

Prompt and response text capture are on by default. To keep request metadata but skip the text, pass the two inputs as 0:

php vendor/bin/dr recipe:apply recipes/ai_recipe_observability_views --input='ai_recipe_observability_views.log_input=0' --input='ai_recipe_observability_views.log_output=0'

You can change text capture later in the AI Observability settings.

The recipe sets Logger to write to the database only, down to the info level, and replaces any existing Logger targets and field selection. This affects every Drupal logging channel, not only AI. Re-add file or syslog targets afterwards if you need them. Logs can contain prompts, responses and provider configuration, so review Logger DB retention (93 days by default with cron cleanup) and who holds the Administer AI Observability permission. No role receives that permission automatically.

Configuration effects

  • Enables AI Observability logging for all four supported lifecycle events and removes the tag restriction.
  • Sets Logger output to the database target and defines the stored fields: service name, UUID, time, timestamp, channel, severity, raw message, request URI, user ID, metadata and exception. Undefined context fields are stored too.
  • Adds five Views, one AI requests Reports menu link and the chart tabs.
  • Leaves providers, credentials, role permissions, OpenTelemetry settings, Logger DB retention and the default Charts configuration untouched. Chart.js loads through Charts library discovery with a CDN fallback.

Related Modules

Other ways to see AI activity

Modules that record or expose AI requests and token usage.

Requirements/Dependencies

  • AI 1.4.0 or later, with its AI Observability submodule, plus a configured AI provider to produce events. The recipe does not configure credentials or choose a model.
  • Logger 1.0.0-alpha6 or later and Logger DB 1.0.0-alpha4 or later. Both are alpha releases and are not covered by the Drupal security advisory policy.
  • Charts 5.2.3 or later with its bundled Chart.js integration.
  • Drupal 11.4 or later. Logger DB alpha4 was tested with the legacy mysql database driver name and does not yet support Drupal 11.4's namespaced driver identifier.
  • NOTE: This recipe assumes that you know how to setup AI module and a provider, this will only setup the logging part.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2026
Latest release
7 hours ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0-beta1 Pre-release Sep 6, 2026