cmelius/opentelemetry-auto-twig 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cmelius/opentelemetry-auto-twig

Composer 安装命令:

composer require cmelius/opentelemetry-auto-twig

包简介

OpenTelemetry Twig Instrumentation

README 文档

README

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

This package provides automatic instrumentation for Twig templates.

Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.

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

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.<type>, where <type> 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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固