You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-34
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ All OpenTelemetry libraries are distributed via packagist, notably:
55
55
56
56
The [open-telemetry/opentelemetry](https://packagist.org/packages/open-telemetry/opentelemetry) package contains all of the above and is the easiest way to try out OpenTelemetry.
57
57
58
+
The [open-telemetry/opentelemetry-php-instrumentation](https://github.com/open-telemetry/opentelemetry-php-instrumentation) extension can be installed to enable auto-instrumentation of PHP code (in conjunction with contrib modules).
59
+
58
60
---
59
61
This repository also hosts and distributes generated client code used by individual components as separate packages. These packages are:
@@ -76,13 +78,10 @@ Additional packages, demos and tools are hosted or distributed in the [OpenTelem
76
78
77
79
| Signal | Status | Project |
78
80
|---------|--------|---------|
79
-
| Traces |Alpha| N/A |
80
-
| Metrics |Alpha| N/A |
81
+
| Traces |Beta | N/A |
82
+
| Metrics |Beta | N/A |
81
83
| Logs | N/A | N/A |
82
84
83
-
This project currently lives in a **alpha status**. Our current release is not production ready; it has been created in order to receive feedback from the community. \
84
-
As long as this project is in alpha status, things may and probably will break once in a while.
85
-
86
85
## Specification conformance
87
86
We attempt to keep the [OpenTelemetry Specification Matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/master/spec-compliance-matrix.md) up to date in order to show which features are available and which have not yet been implemented.
88
87
@@ -106,7 +105,11 @@ mentioned in the provided messages, since doing otherwise may break things compl
106
105
107
106
# Requirements
108
107
109
-
The library and all separate packages requires a PHP version of 7.4.x, 8.0.x or 8.1.x
108
+
The library and all separate packages requires a PHP version of 7.4+
109
+
110
+
If you want to try out open-telemetry, you can install the entire [open-telemetry](https://packagist.org/packages/open-telemetry/opentelemetry) package, which includes the API, SDK, exporters and extensions.
111
+
112
+
For a production install, we recommend installing only the components that you need, for example API, SDK, and an exporter.
110
113
111
114
## Required dependencies
112
115
### 1) Install PSR17/18 implementations
@@ -160,14 +163,14 @@ however most OS` package managers provide a package for the extension.
_Experimental_ support for using fibers in PHP 8.1 for Context storage requires the `ffi` extension, and can
166
+
Support for using fibers in PHP 8.1 for Context storage requires the `ffi` extension, and can
164
167
be enabled by setting the `OTEL_PHP_FIBERS_ENABLED` environment variable to a truthy value (`1`, `true`, `on`).
165
168
166
169
Using fibers with non-`CLI` SAPIs may require preloading of bindings. One way to achieve this is setting [`ffi.preload`](https://www.php.net/manual/en/ffi.configuration.php#ini.ffi.preload) to `src/Context/fiber/zend_observer_fiber.h` and setting [`opcache.preload`](https://www.php.net/manual/en/opcache.preloading.php) to `vendor/autoload.php`.
**The PHP protobuf extension is optional when using either the `OTLPHttp` or `OTLPGrpc` exporters from the Contrib package.**
173
+
**The PHP protobuf extension is recommended when using the `otlp` exporter from the Contrib package.**
171
174
172
175
The protobuf extension makes both exporters _significantly_ more performant, and we recommend that you do not use the PHP package in production. _Note that protobuf 3.20.0+ is required for php 8.1 support_
173
176
@@ -233,11 +236,18 @@ For development and testing purposes you also want to install **SDK** and **Cont
If all [configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration) is provided via environment variables or `php.ini`, then an SDK can be auto-loaded.
242
+
SDK autoloading must be enabled via the `OTEL_PHP_AUTOLOAD_ENABLED` setting, and will be performed as part of composer autoloading.
243
+
244
+
See [autoload_sdk.php example](./examples/autoload_sdk.php)
245
+
236
246
## Trace signals
237
247
238
248
### Auto-instrumentation
239
249
240
-
_We do not currently support auto-instrumentation, but are internally discussing how to implement it_
250
+
Auto-instrumentation is available via our [otel_instrumentation](https://github.com/open-telemetry/opentelemetry-php-instrumentation) PHP extension, and there are some auto-instrumentation modules available in our [contrib repo](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation).
241
251
242
252
### Framework instrumentation
243
253
@@ -251,9 +261,12 @@ If you wish to build your own instrumentation for your application, you will nee
251
261
Tracers must be obtained from a `TracerProvider`:
252
262
253
263
```php
264
+
$transport = (new OpenTelemetry\Contrib\Grpc\GrpcTransportFactory())->create('http://collector:4317' . OtlpUtil::method(Signals::TRACE));
265
+
$exporter = new OpenTelemetry\Contrib\Otlp\SpanExporter($transport);
254
266
$tracerProvider = new \OpenTelemetry\SDK\Trace\TracerProvider(
255
267
new \OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor(
256
-
new \OpenTelemetry\Contrib\OtlpGrpc\Exporter('otel-collector:4317')
0 commit comments