This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.
- OpenTelemetry extension
- OpenTelemetry SDK + exporter (required to actually export traces)
- WordPress installation
- OpenTelemetry SDK Autoloading configured
OpenTelemetry depends on composer, unlike Wordpress. This extension was developed against johnpbloch/wordpress-core, but it should also work with other installation methods.
An example in Docker of extending the official Wordpress image to enable auto-instrumentation: https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/examples/instrumentation/Wordpress
Configure (eg via .htaccess
) a PHP prepend file to initialize composer:
php_value auto_prepend_file /var/www/vendor/autoload.php
This will install the composer autoloader before running Wordpress. As part of composer autoloading, scripts are executed for installed modules, importantly:
- OpenTelemetry SDK Autoloader
- this library's
_register.php
file
$ composer require open-telemetry/opentelemetry-auto-wordpress
The extension can be disabled via runtime configuration:
OTEL_PHP_DISABLED_INSTRUMENTATIONS=wordpress