This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
This is an OpenTelemetry auto-instrumentation package for the ReactPHP HTTP library. Currently only the Browser (client) component is instrumented.
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.
This library is provides the following:
- OpenTelemetry Semantic Conventions v1.32.0:
- HTTP Client Spans - required and HTTP header (opt-in) attributes only
- HTTP Client Metrics - required attributes only
- W3C Trace Context:
Note
HTTP Client 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 an environment variable, e.g.:
OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS="GET,HEAD,POST,PUT,DELETE,CONNECT,OPTIONS,TRACE,PATCH,MyCustomMethod"
Additional HTTP query string parameters can be redacted via an environment variable, e.g.,
OTEL_PHP_INSTRUMENTATION_URL_SANITIZE_FIELD_NAMES="password,passwd,pwd,secret"
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"