Configuration

Settings page

Without the environment variables, Site administration > Plugins > Admin tools > OpenTelemetry tracing has the same options (enable, endpoint, headers, sampling rate, service name). The page shows which configuration is active.

Start before Moodle (optional)

By default tracing starts from the after_config hook, so the request span misses the Moodle setup. To include it, start the plugin before Moodle (requires the environment variables):

auto_prepend_file=/var/www/html/public/admin/tool/otel/prepend.php

If tool_sentry is also in prepend mode, only one file can be prepended: create a small file that includes both.

Task spans (optional)

Each scheduled and adhoc task run becomes a span (with its real start and end times) when the task logger of the plugin is set in config.php. It keeps the core task log too:

$CFG->task_log_class = '\tool_otel\task_logger';

Moodle calls the task logger according to Site administration > Server > Tasks > Task log configuration: with Log mode set to failures only ($CFG->task_logmode = 1), only failed runs become spans. Log all task output to trace every run.