定制 moodlehq/moodle-package-otel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

moodlehq/moodle-package-otel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require moodlehq/moodle-package-otel

包简介

OpenTelemetry integration for Moodle LMS

README 文档

README

This is the OpenTelemetry integration for Moodle. It must be installed using composer, and requires the OpenTelemetry PHP Extension.

Installation

Open Telemetry requires the installation of the Open Telemetry PHP Extension.

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

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

The extension can be disabled via runtime 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

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

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

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固