This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.
Auto-instrumentation hooks are registered via composer, which will:
- create spans automatically for each ReactPHP HTTP Browser request that is sent
- add a
traceparent
header to the request to facilitate distributed tracing
Note that span lifetime behavior differs based on how ReactPHP is utilized; see examples/README.md for more information.
The extension can be disabled via runtime configuration:
OTEL_PHP_DISABLED_INSTRUMENTATIONS=reactphp
Custom HTTP methods can replace the known methods via environment variables, e.g.:
OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS="GET,HEAD,POST,PUT,DELETE,CONNECT,OPTIONS,TRACE,PATCH,MyCustomMethod"
Request and/or response headers can be added as span attributes via environment variables, e.g.:
OTEL_PHP_INSTRUMENTATION_HTTP_REQUEST_HEADERS=Accept
OTEL_PHP_INSTRUMENTATION_HTTP_RESPONSE_HEADERS="Content-Length,Content-Type"