定制 mmo/opentelemetry-auto-yii2-web 二次开发

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

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

mmo/opentelemetry-auto-yii2-web

Composer 安装命令:

composer require mmo/opentelemetry-auto-yii2-web

包简介

OpenTelemetry auto-instrumentation for Yii2 web app

README 文档

README

This package provides automatic instrumentation for the Yii2 web applications using OpenTelemetry.

Requirements

  • PHP 8.2+
  • OpenTelemetry PHP Extension (ext-opentelemetry)

Installation

You can install the package via Composer:

composer require mmo/opentelemetry-auto-yii2-web

Usage

The instrumentation is automatically registered via Composer's autoloading mechanism (using _register.php). As long as the package is installed and the opentelemetry extension is loaded, it will hook into Yii2's core methods.

Disabling Instrumentation

You can disable this specific instrumentation by setting the OTEL_PHP_DISABLED_INSTRUMENTATIONS environment variable:

export OTEL_PHP_DISABLED_INSTRUMENTATIONS=mmo-yii2-web

How it works

The library uses the OpenTelemetry hook() function to intercept key Yii2 methods:

  • Inline Actions: Wraps runWithParams in a span to monitor action logic execution.
  • View Rendering: Wraps render in a span to measure time spent rendering templates.
  • View File Path: Hooks into findViewFile to enrich the current span with the exact path of the rendered file.

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-21