Download the PHP package cmelius/opentelemetry-auto-twig without Composer
On this page you can find all versions of the php package cmelius/opentelemetry-auto-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmelius/opentelemetry-auto-twig
More information about cmelius/opentelemetry-auto-twig
Files in cmelius/opentelemetry-auto-twig
Package opentelemetry-auto-twig
Short Description OpenTelemetry Twig Instrumentation
License Apache-2.0
Homepage https://github.com/cmelius
Informations about the package opentelemetry-auto-twig
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
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
-
Install the OpenTelemetry PHP Extension: This package relies on the
opentelemetryPHP extension for automatic hooking. -
Install the Composer package:
- Enable Twig-Instrumentation:
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.