@@ -18,11 +18,11 @@ Automatic instrumentation with PHP requires:
18
18
[ instrumentation libraries] ( /ecosystem/registry/?component=instrumentation&language=php )
19
19
- [ Configuration] ( #configuration )
20
20
21
+ ## Install the OpenTelemetry extension
22
+
21
23
{{% alert title="Important" color="warning" %}}Installing the OpenTelemetry
22
24
extension by itself does not generate traces. {{% /alert %}}
23
25
24
- ## Install the OpenTelemetry extension
25
-
26
26
The extension can be installed via pecl,
27
27
[ pickle] ( https://github.com/FriendsOfPHP/pickle ) or
28
28
[ php-extension-installer] ( https://github.com/mlocati/docker-php-extension-installer )
@@ -130,13 +130,16 @@ Automatic instrumentation is available for a number commonly used PHP libraries.
130
130
For the full list, see
131
131
[ instrumentation libraries on packagist] ( https://packagist.org/search/?query=open-telemetry&tags=instrumentation ) .
132
132
133
- Let's assume that your application uses Slim Framework and a PSR-18 HTTP client.
134
- You would then install the SDK and corresponding auto-instrumentation packages
135
- for these:
133
+ Let's assume that your application uses Slim Framework and a PSR-18 HTTP client,
134
+ and that we will export the traces with the OTLP protocol.
135
+
136
+ You would then install the SDK, an exporter and auto-instrumentation packages for Slim Framework
137
+ and PSR-18:
136
138
137
139
``` shell
138
140
composer require \
139
141
open-telemetry/sdk \
142
+ open-telemetry/exporter-otlp \
140
143
open-telemetry/opentelemetry-auto-slim \
141
144
open-telemetry/opentelemetry-auto-psr18
142
145
```
@@ -152,8 +155,8 @@ variables or the `php.ini` file to configure auto-instrumentation.
152
155
OTEL_PHP_AUTOLOAD_ENABLED=true \
153
156
OTEL_SERVICE_NAME=your-service-name \
154
157
OTEL_TRACES_EXPORTER=otlp \
155
- OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
156
- OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317 \
158
+ OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
159
+ OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 \
157
160
OTEL_PROPAGATORS=baggage,tracecontext \
158
161
php myapp.php
159
162
```
@@ -167,8 +170,8 @@ by PHP:
167
170
OTEL_PHP_AUTOLOAD_ENABLED =" true"
168
171
OTEL_SERVICE_NAME =your-service-name
169
172
OTEL_TRACES_EXPORTER =otlp
170
- OTEL_EXPORTER_OTLP_PROTOCOL =grpc
171
- OTEL_EXPORTER_OTLP_ENDPOINT =http://collector:4317
173
+ OTEL_EXPORTER_OTLP_PROTOCOL =http/protobuf
174
+ OTEL_EXPORTER_OTLP_ENDPOINT =http://collector:4318
172
175
OTEL_PROPAGATORS =baggage,tracecontext
173
176
```
174
177
0 commit comments