Telemetry
Moodle 5.2 introduced built-in support for OpenTelemetry (OTel), an open-source observability standard that enables administrators and developers to trace, monitor, and understand the performance and behaviour of a Moodle site in real time.
This initial release focuses on automatic instrumentation; no changes to Moodle code are required. Once configured, Moodle generates telemetry span data that can be collected and visualised by any OpenTelemetry-compatible monitoring tool.
What is automatically traced?
Once set up, Moodle generates telemetry spans for:
- All web requests and CLI operations
- Routing which controller and action handled each request
- Scheduled and ad-hoc tasks (cron)
- Event dispatch and bulk event processing
- Web service calls one span per external function call
Requirements
OpenTelemetry support requires the following to be configured outside of Moodle:
- The OpenTelemetry PHP extension, installed via PECL: pecl install opentelemetry
- The Composer package, added to your Moodle installation: composer require moodlehq/moodle-package-otel
- An OTel exporter: composer require open-telemetry/exporter-otlp
All OpenTelemetry configuration must be defined in php.ini or as environment variables it cannot be configured through the Moodle admin UI.
Viewing the data
Traces can be visualised using any OpenTelemetry-compatible backend, such as SigNoz (open source), Jaeger, Grafana Tempo, Honeycomb, or Datadog.
Disabling instrumentation
The integration can be disabled entirely, or individual components can be turned off using environment variables:
- Disable all: OTEL_PHP_DISABLED_INSTRUMENTATIONS=moodlelms
- Disable cron only: OTEL_PHP_DISABLED_INSTRUMENTATIONS=moodlelms.cronlistener
Further information
- moodle-package-otel package on GitHub: https://github.com/moodlehq/moodle-package-otel