Configuration - Drupal

3 min read Updated: 11.09.2026

On this page Where the configuration lives
  1. Where the configuration lives
  2. Configuration source
  3. Environments
  4. How reporting works
  5. Transactions
  6. JavaScript errors
  7. Reporting by hand
  8. Protecting the private key

Where the configuration lives

Administration → Configuration → Development → DockRay, that is /admin/config/development/dock-ray. The form shows a live configuration status, the result of the last test and a Send a test event button that checks the connection without leaving the page.

Configuration source

Configuration source decides how a settings.php override and the form's own saved values interact:

SourceBehaviour
Auto (default)a key set in settings.php wins for that field, everything else comes from the form. This is exactly how the module behaved before this field existed - nobody's settings.php stops working.
settings.php onlythe form's token, key and URL are ignored even if filled in; a field with no matching key falls back to its default rather than to the form
This form onlysettings.php is ignored even if it defines an override - useful when a shared settings file bakes in a default project and one site needs its own

Locked fields are shown with the value actually in effect and a note explaining why. They still submit that value with the rest of the form: a disabled Form API element commits #default_value instead of dropping the key, so saving while a field is locked cannot blank what is stored.

Environments

Every environment should report under an unambiguous name - production, staging, preview. The name is a column in the panel and a filter on the error list, so without it a production outage looks exactly like an error someone triggered in a test. Leave your local environment without credentials: with no token and no key the integration loads and stays silent, so you do not need a separate switch to turn it off.

How reporting works

The module registers a logger channel. Drupal already turns every PHP error and every uncaught exception into a log entry, so one channel covers the lot - and there is no second error handler competing with the core one.

minimum_level is an RFC 5424 severity: 3 (Error) reports errors, criticals, alerts and emergencies, and ignores warnings and notices. An entry carrying an exception is reported with its stack trace; the rest become messages.

LevelCovers
2 Criticalcritical failures and above only
3 Errorrecommended: errors and anything more serious
4 Warningwarnings as well - substantially more events on a large site

Transactions

Request handling is measured only when traces_sample_rate is above zero. A transaction opens on kernel.request and closes on kernel.terminate. Nothing goes out during the request: events queue up and leave from a shutdown handler once the response has been flushed, so a slow panel never delays a page.

JavaScript errors

Off by default. Once enabled, the module loads a collector on non-admin pages that reports window.onerror and unhandled promise rejections to the site, not to the panel: a browser cannot authenticate against DockRay without the private key, which would then be readable in page source.

Reports go to POST /dock-ray/browser-error, limited to 16 KB and rate limited through Drupal's flood service to 20 per IP address per hour. The collector itself is served from /dock-ray/collector.js, because the SDK lives in the project's vendor/ directory, outside the docroot on most installs. Every request answers 202 whether or not the report was accepted.

Reporting by hand

php
try {
  $this->import();
}
catch (\Throwable $exception) {
  \Drupal::service('dock_ray.hub')->captureException($exception);

  throw $exception;
}

\Drupal::logger('my_module')->error(...) reaches DockRay as well - through the same channel as everything else, so your own code needs no separate integration.

Protecting the private key

The private key is a project secret, not an identifier. Keep it in environment variables, in a secrets manager or in the server configuration - never in the repository, in logs, in a screenshot or in code sent to the browser. One project can hold many keys, so production and staging should each get their own: either can be revoked on its own without interrupting the others. A suspicion that a key leaked is reason enough to revoke it and generate a new one.

Keep reading

DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.