open-telemetry/opentelemetry-auto-reactphp

OpenTelemetry auto-instrumentation for ReactPHP's HTTP Browser.

0.1.0 2025-05-21 12:33 UTC

This package is auto-updated.

Last update: 2025-05-21 12:35:15 UTC


README

Releases Issues Source Mirror Latest Version Stable

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

OpenTelemetry ReactPHP HTTP Browser auto-instrumentation

Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.

Overview

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.

Configuration

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"