PHPackages                             moodlehq/moodle-package-otel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. moodlehq/moodle-package-otel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

moodlehq/moodle-package-otel
============================

OpenTelemetry integration for Moodle LMS

v1.0.0(2mo ago)00GPL-3.0-or-laterPHPCI passing

Since Feb 24Pushed 2mo agoCompare

[ Source](https://github.com/moodlehq/moodle-package-otel)[ Packagist](https://packagist.org/packages/moodlehq/moodle-package-otel)[ RSS](/packages/moodlehq-moodle-package-otel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Moodle OpenTelemetry Integration for Moodle
===========================================

[](#moodle-opentelemetry-integration-for-moodle)

This is the OpenTelemetry integration for Moodle. It must be installed using composer, and requires the [OpenTelemetry PHP Extension](https://github.com/open-telemetry/opentelemetry-php-instrumentation/).

Installation
------------

[](#installation)

Open Telemetry requires the installation of the [Open Telemetry PHP Extension](https://github.com/open-telemetry/opentelemetry-php-instrumentation).

After the installation of Moodle, and the Open Telemetry extension, this plugin can be installed using composer:

```
composer require moodlehq/moodle-package-otel
```

Exporters and Protocols must also be installed per your requirements, for example:

```
composer require open-telemetry/exporter-otlp
```

PHP Configuration will be required as described by your preferred exporter.

Overview
--------

[](#overview)

Auto-instrumentation hooks are registered via composer, and spans will be automatically created for (`moodlelms`):

- Every access (root span), including for:
    - Web Requests
    - CLI Usage
- When a web request is made using the Moodle Routing engine:
    - App::handle() - update the root span with Routing-specific information
    - InvocationStrategyInterface - controller/action
    - RoutingMiddleware::performRouting - update the root span's name with either route name or pattern

Spans are also created for:

- Tasks (`moodlelms.cronlistener`) - for the processing of each
    - scheduled task; and
    - adhoc task.
- Moodle Events (`moodlelms.eventlistener`) - for the processing of Logging Events at:
    - time of event dispatch; and
    - time of bulk processing.
- Web Service Requests (`moodlelms.externalapilistener`) - one span per external function call.

Configuration
-------------

[](#configuration)

The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/languages/php/sdk/#configuration):

The core functionality and all child listeners can be disabled using:

```
OTEL_PHP_DISABLED_INSTRUMENTATIONS=moodlelms
```

To disable instrumentation for one of the groups of child listeners:

```
OTEL_PHP_DISABLED_INSTRUMENTATIONS=moodlelms.cronlistener
```

Adding additional instrumentation
---------------------------------

[](#adding-additional-instrumentation)

You can add other auto-instrumentation using composer.

If you wish to create Moodle-specific instrumentation you can either do so as a standard Open Telemetry instrumentation, or you can create a Moodle Package.

### Creating Moodle Open Telemetry Auto Instrumentation packages

[](#creating-moodle-open-telemetry-auto-instrumentation-packages)

To create your own page, you should:

- specify a package type of `moodle-package-otelhook`
- define your listeners with each listener implementing the `Moodlehq\MoodlePackageOtel\Instrumentation\MoodleListenerInterface` interface and optionally using the `Moodlehq\MoodlePackageOtel\Instrumentation\MoodleListenerTrait` trait
- define a `\Namespace\Instrumentation\ListenersDescriber` class which implements `\Moodlehq\MoodlePackageOtel\Instrumentation\ListenersDescriberInterface`
- define your listeners in the `ListenersDescriber` class

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance85

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

78d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af50aff7bc9a1b0863806f0a384ce233451b87a1425b4b4de51aea64810ace59?d=identicon)[andrewnicols](/maintainers/andrewnicols)

![](https://www.gravatar.com/avatar/d7400b12cc228753df732a0ff6e177f6f799b040095972d0b62af2d4a6eda436?d=identicon)[abgreeve](/maintainers/abgreeve)

---

Top Contributors

[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/moodlehq-moodle-package-otel/health.svg)

```
[![Health](https://phpackages.com/badges/moodlehq-moodle-package-otel/health.svg)](https://phpackages.com/packages/moodlehq-moodle-package-otel)
```

###  Alternatives

[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[instride/data-definitions

Data Definitions allows you to define your DataObject Imports and Exports using a nice GUI and re-run the definitions as often you like.

8117.7k](/packages/instride-data-definitions)[plunkettscott/laravel-otel

OpenTelemetry for Laravel

294.6k](/packages/plunkettscott-laravel-otel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
