php.ini has to be updated manually (#2192)

Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
This commit is contained in:
Przemyslaw Delewski 2023-01-24 23:22:19 +01:00 committed by GitHub
parent d0e90892b1
commit 23d6adcc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 22 deletions

View File

@ -6,8 +6,8 @@ weight: 2
Automatic instrumentation with PHP requires at least PHP 8.0, and
[the opentelemetry PHP extension](https://github.com/open-telemetry/opentelemetry-php-instrumentation).
The extension allows developers code to hook into classes and methods,
and execute userland code before and after.
The extension allows developers code to hook into classes and methods, and
execute userland code before and after.
## Example
@ -45,17 +45,30 @@ function ends it.
## Setup
1. Install the extension via [pickle](https://github.com/FriendsOfPHP/pickle) or [php-extension-installer](https://github.com/mlocati/docker-php-extension-installer) (docker specific):
1. Install the extension via [pickle](https://github.com/FriendsOfPHP/pickle)
or
[php-extension-installer](https://github.com/mlocati/docker-php-extension-installer)
(docker specific):
* **pickle** can be used to install extensions that are available via http://pecl.php.net, however that's not the case
for opentelemetry-php-instrumentation yet, so the only way for it is to install directly from source code.
Following command line shows how to do that using specific version of extension (1.0.0beta1 in this case).
- **pickle** can be used to install extensions that are available via
http://pecl.php.net, however that's not the case for
opentelemetry-php-instrumentation yet, so the only way for it is to
install directly from source code. The following command line shows you
how to do that using a specific version of the extension (1.0.0beta2 in
this case):
```console
$ php pickle.phar install --source https://github.com/open-telemetry/opentelemetry-php-instrumentation.git#1.0.0beta1
$ php pickle.phar install --source https://github.com/open-telemetry/opentelemetry-php-instrumentation.git#1.0.0beta2
```
* **php-extension-installer**
Add the extension to your `php.ini` file:
```ini
[Otel instrumentation]
extension=otel_instrumentation.so
```
- **php-extension-installer**
```console
$ install-php-extensions open-telemetry/opentelemetry-php-instrumentation@main
```
@ -109,10 +122,12 @@ $tracerProvider = $instrumentation->tracer();
## Supported libraries and frameworks
Automatic Instrumentation comes with a number of instrumentation libraries for commonly used PHP libraries.
For the full list, see [instrumentation libraries on packagist](https://packagist.org/search/?query=open-telemetry&tags=instrumentation).
Automatic Instrumentation comes with a number of instrumentation libraries for
commonly used PHP libraries. For the full list, see
[instrumentation libraries on packagist](https://packagist.org/search/?query=open-telemetry&tags=instrumentation).
## Next steps
After you have automatic instrumentation configured for your app or service, you
might want to add [manual instrumentation](../manual) to collect custom telemetry data.
might want to add [manual instrumentation](../manual) to collect custom
telemetry data.