• /
  • EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

Drupal-specific functionality

The PHP agent captures special metrics for Drupal websites. When these metrics are collected, a Drupal tab appears in the New Relic user interface: Go to one.newrelic.com > All capabilities > APM & services > (select a Drupal app).

Configuration

The collection of Drupal-specific metrics can be controlled by newrelic.framework.drupal.modules. It is enabled by default (in versions 3.0 or higher), and can be disabled with:

newrelic.framework.drupal.modules = 0

Though this setting uses the word "modules," it controls the collection of all Drupal metrics: modules, views, and hooks.

Metrics

The PHP agent collects metrics for the following:

  • Modules: Versions 2.5 or higher. These metrics indicate time spent within each Drupal module. In versions 3.5 or higher, time is calculated from the hook dispatch functions module_invoke and module_invoke_all. In previous versions, time was calculated from functions from a file with the ".module" extension where the file name and function prefix were a match.
  • Hooks: Versions 3.5 or higher. These metrics indicate time spent within each Drupal hook. Time is calculated from the hook dispatch functions module_invoke and module_invoke_all.
  • Views: Versions 3.5 or higher. These metrics indicate time spent within a view's view::execute method.

Drupal and Browser instrumentation

In Drupal 7.15, Compress cached pages is turned on by default. If you also select Cache pages for anonymous users, the JavaScript is not inserted into the served pages for anonymous users. This is because Drupal's pages are compressed directly from the database before they are stored in the cache (with gzip), so New Relic's PHP agent does not have a chance to parse any HTML.

In this situation, manual instrumentation provides a better opportunity to capture data for anonymous users. For more information, see Browser monitoring and the PHP agent

Drupal 10.2 introduced a new change that causes it to set a content-length header. New Relic PHP agent is unable to auto-inject the browser auto-instrumentation when the HTTP header field Content-Length is set. To keep using browser monitoring, disable browser auto-instrumentation and manually insert the JavaScript header and footer into your templates. For more information, please see here.

Cron tasks

Drupal supports periodically executing tasks to perform routine maintenance or similar work on behalf of installed Drupal modules. These tasks can be run without any manual involvement beyond the initial configuration. Commonly, these are referred to as cron tasks. Starting in version 4.3, the New Relic PHP agent detects the execution of these tasks and automatically marks them as background transactions regardless of how they were started.

Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.