https://github.com/opentelemetry-php/contrib-auto-wordpress
[READONLY] OpenTelemetry Wordpress auto-instrumentation
https://github.com/opentelemetry-php/contrib-auto-wordpress
Last synced: 10 months 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 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-30T23:36:51.000Z (11 months ago)
- Last Synced: 2025-07-31T02:08:14.899Z (11 months ago)
- Language: PHP
- Size: 26.4 KB
- Stars: 14
- 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
```