drupal / ai_observability_opentel_recipe
Enables Drupal AI observability + OpenTelemetry and points them at an OTLP collector (pairs with the ddev-drupal-ai-observability DDEV add-on). No AI provider, no agents.
Package info
git.drupalcode.org/project/ai_observability_opentel_recipe.git
Type:drupal-recipe
pkg:composer/drupal/ai_observability_opentel_recipe
Requires
- drupal/ai: ^1.4
- drupal/core: ^10.3 || ^11
- drupal/opentelemetry: ^1.0@beta
This package is auto-updated.
Last update: 2026-07-21 14:08:55 UTC
README
Enables and configures the Drupal-side half of the AI observability setup:
- Modules:
ai+ai_observability,opentelemetry+opentelemetry_metrics+opentelemetry_logs. - Config: points
opentelemetry.settingsat the OTLP collector (http://grafana-alloy:4318,http/protobuf) and switches onai_observability's OpenTelemetry export (spans + metrics).
It pairs with the
ddev-drupal-ai-observability
DDEV add-on, which provides the receiving Grafana/Tempo/Mimir/Loki/Alloy stack
and the dashboards. Install the add-on first; then every AI request your site
makes shows up in Grafana.
What it deliberately does NOT do
- No AI provider — install and configure one yourself (e.g.
drupal/ai_provider_openai) including its API key (use the Key module with an env-var provider; never commit keys). - No agents — the agent dashboards light up once you install
drupal/ai_agents(≥ 1.4) and create agents; nothing here depends on it. No prompt/response storage —
otel_spans_store_input/_outputstay off (privacy default). The Grafana Message flow panel needs them:drush cset ai_observability.settings otel_spans_store_input true -y drush cset ai_observability.settings otel_spans_store_output true -y⚠️ This stores prompt/response text (truncated ~1 KB) in your traces.
Zero-to-running with the one-line installer
This repo ships a .drupalaibp.json for the
one_line_installer
(drupalaibp), which builds the whole project unattended — DDEV + Drupal +
the ddev-drupal-ai-observability
Grafana stack + this recipe:
git clone https://git.drupalcode.org/project/ai_observability_opentel_recipe.git
cd ai_observability_opentel_recipe
bash <(curl -fsSL https://project.pages.drupalcode.org/one_line_installer/drupalaibp)
The installer detects .drupalaibp.json and runs the build from it. You land
on a site where the observability pipeline is fully wired — no AI provider
is installed, by design: pick whichever you want (see below), and as soon as
it makes its first request it shows up traced, metered, and priced in Grafana.
Apply (recipe only, on an existing site)
The modules must be present in the codebase first (recipes don't run Composer):
ddev composer require drupal/ai_observability_opentel_recipe
ddev drush recipe:apply /var/www/html/recipes/ai_observability_opentel_recipe
ddev drush cr
(Requiring the recipe via Composer pulls drupal/ai and
drupal/opentelemetry in for you — its composer.json declares both.)
After applying
- Install + configure an AI provider and set default models at
/admin/config/ai/settings. - Make an AI call — then open Grafana at
https://<project>.ddev.site:3000and check the AI Requests — Overview dashboard. - Optional:
drupal/ai_agentsfor the agent-session dashboards, andddev sync-model-pricesfor live cost pricing.
Customizing the endpoint
Not on DDEV / different collector? Override after applying:
drush cset opentelemetry.settings endpoint 'http://my-collector:4318' -y