PHPackages                             mmo/opentelemetry-auto-yii2-web - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mmo/opentelemetry-auto-yii2-web

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mmo/opentelemetry-auto-yii2-web
===============================

OpenTelemetry auto-instrumentation for Yii2 web app

02PHP

Since Mar 29Pushed 3mo agoCompare

[ Source](https://github.com/morawskim/opentelemetry-auto-yii2-web)[ Packagist](https://packagist.org/packages/mmo/opentelemetry-auto-yii2-web)[ RSS](/packages/mmo-opentelemetry-auto-yii2-web/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

OpenTelemetry Auto-Instrumentation for Yii2 Web
===============================================

[](#opentelemetry-auto-instrumentation-for-yii2-web)

This package provides automatic instrumentation for the [Yii2](https://www.yiiframework.com/) web applications using [OpenTelemetry](https://opentelemetry.io/).

Requirements
------------

[](#requirements)

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

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

[](#installation)

You can install the package via [Composer](https://getcomposer.org/):

```
composer require mmo/opentelemetry-auto-yii2-web
```

Usage
-----

[](#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

[](#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
------------

[](#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
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE.txt](LICENSE.txt) file for details.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance55

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f48903acba8913dc7efd484ee70d647f77d41f24a261aab64cb27231ea0b7aa?d=identicon)[morawskim](/maintainers/morawskim)

---

Top Contributors

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

---

Tags

instrumentationopen-telemetryopentelemetryoteltracingyii2

### Embed Badge

![Health badge](/badges/mmo-opentelemetry-auto-yii2-web/health.svg)

```
[![Health](https://phpackages.com/badges/mmo-opentelemetry-auto-yii2-web/health.svg)](https://phpackages.com/packages/mmo-opentelemetry-auto-yii2-web)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B10.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1938.5M261](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)

PHPackages © 2026

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