open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
686 stars 170 forks source link

[opentelemetry-php-instrumentation] PHP8.2 support registering hooks after a function was already executed #1307

Open Nevay opened 1 month ago

Nevay commented 1 month ago

PHP ^8.2 allows manipulation of observers at runtime https://github.com/php/php-src/pull/9062.

Should allow us to remove the limitation that hooks must be registered before a function is first executed. https://github.com/open-telemetry/opentelemetry-php-instrumentation?tab=readme-ov-file#caveats

Hooks must be registered before a function is first executed. You may encounter race conditions where the composer autoloader runs code that uses functions you wish to hook prior to the hooks being registered.

brettmc commented 1 month ago

ref: #1278 The feature is available in PHP from 8.2.0