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(4mo ago)030GPL-3.0-or-laterPHPCI passing

Since Feb 24Pushed 6d ago1 watchersCompare

[ 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 3w 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

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

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

123d ago

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/1161797?v=4)[Adrian Greeve](/maintainers/abgreeve)[@abgreeve](https://github.com/abgreeve)

---

Top Contributors

[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (3 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

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M519](/packages/shopware-core)[internal/dload

Downloads binaries.

102187.3k17](/packages/internal-dload)

PHPackages © 2026

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