https://github.com/opentelemetry-php/contrib-auto-wordpress
[READONLY] OpenTelemetry Wordpress auto-instrumentation
https://github.com/opentelemetry-php/contrib-auto-wordpress
Last synced: 1 day ago
JSON representation
[READONLY] OpenTelemetry Wordpress auto-instrumentation
- Host: GitHub
- URL: https://github.com/opentelemetry-php/contrib-auto-wordpress
- Owner: opentelemetry-php
- Created: 2023-02-01T13:48:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-14T00:20:02.000Z (2 months ago)
- Last Synced: 2025-05-14T02:22:43.184Z (2 months ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 13
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/opentelemetry-php/contrib-auto-wordpress/releases)
[](https://github.com/open-telemetry/opentelemetry-php/issues)
[](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/Wordpress)
[](https://github.com/opentelemetry-php/contrib-auto-wordpress)
[](https://packagist.org/packages/open-telemetry/opentelemetry-auto-wordpress/)
[](https://packagist.org/packages/open-telemetry/opentelemetry-auto-wordpress/)This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
# OpenTelemetry Wordpress auto-instrumentation
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to
install and configure the extension and SDK.## Requirements
* OpenTelemetry extension
* OpenTelemetry SDK + exporter (required to actually export traces)
* WordPress installation
* OpenTelemetry [SDK Autoloading](https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/autoload_sdk.php) configured## Overview
OpenTelemetry depends on composer, unlike Wordpress. This extension was developed against
[johnpbloch/wordpress-core](https://github.com/johnpbloch/wordpress-core-installer),
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### apache
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## Installation via composer
```bash
$ composer require open-telemetry/opentelemetry-auto-wordpress
```## Configuration
The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):
```shell
OTEL_PHP_DISABLED_INSTRUMENTATIONS=wordpress
```