PHPackages                             cmelius/opentelemetry-auto-twig - 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. [Templating &amp; Views](/categories/templating)
4. /
5. cmelius/opentelemetry-auto-twig

ActiveLibrary[Templating &amp; Views](/categories/templating)

cmelius/opentelemetry-auto-twig
===============================

OpenTelemetry Twig Instrumentation

v1.0.0(5mo ago)1579Apache-2.0PHPPHP ^8.0

Since Dec 2Pushed 5mo agoCompare

[ Source](https://github.com/cmelius/opentelemetry-auto-twig)[ Packagist](https://packagist.org/packages/cmelius/opentelemetry-auto-twig)[ Docs](https://github.com/cmelius)[ RSS](/packages/cmelius-opentelemetry-auto-twig/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Intro
=====

[](#intro)

In my company we needed a twig instrumentation to see what was consuming time. It's a CraftCMS website running on PHP 8.4.

This may not be perfect but it did show us time consumed by twig templates.

OpenTelemetry Twig auto-Instrumentation
=======================================

[](#opentelemetry-twig-auto-instrumentation)

This package provides automatic instrumentation for Twig templates.

Please read  for instructions on how to install and configure the extension and SDK.

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

[](#installation)

1. **Install the OpenTelemetry PHP Extension:** This package relies on the `opentelemetry` PHP extension for automatic hooking.
2. **Install the Composer package:**

    ```
     composer require cmelius/opentelemetry-auto-twig
    ```
3. **Enable Twig-Instrumentation:**

    ```
    putenv('OTEL_PHP_INSTRUMENTATION_TWIG_ENABLED=true');

    ```

Usage
-----

[](#usage)

This package provides fully automatic instrumentation. Once installed, it will automatically trace all Twig template rendering. No further configuration is required.

The instrumentation will create spans with the name `twig.render.`, where `` is the type of template being rendered (e.g., `template`, `block`). The spans will include the following attributes:

- `twig.template`: The name of the template file.
- `twig.name`: The name of the specific template or block being rendered.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance72

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

161d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f98f3d987351c5888c17f1c3c34174c55349139d346e328700a7979202c97e8?d=identicon)[Mehl](/maintainers/Mehl)

---

Top Contributors

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

---

Tags

twigtracingopentelemetryotelinstrumentationopen-telemetry

### Embed Badge

![Health badge](/badges/cmelius-opentelemetry-auto-twig/health.svg)

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

###  Alternatives

[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

531.9M8](/packages/open-telemetry-opentelemetry-auto-laravel)[open-telemetry/opentelemetry-auto-symfony

OpenTelemetry auto-instrumentation for Symfony

551.2M1](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.2M1](/packages/open-telemetry-opentelemetry-auto-pdo)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)

PHPackages © 2026

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