Download the PHP package open-telemetry/context without Composer
On this page you can find all versions of the php package open-telemetry/context. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download open-telemetry/context
More information about open-telemetry/context
Files in open-telemetry/context
Package context
Short Description Context implementation for OpenTelemetry PHP.
License Apache-2.0
Informations about the package context
OpenTelemetry Context
Immutable execution scoped propagation mechanism, for further details see opentelemetry-specification.
Installation
Usage
Implicit propagation
It is recommended to use a try-finally
statement after ::activate()
to ensure that the created scope is properly ::detach()
ed.
Debug scopes
By default, scopes created by ::activate()
warn on invalid and missing calls to ::detach()
in non-production
environments. This feature can be disabled by setting the environment variable OTEL_PHP_DEBUG_SCOPES_DISABLED
to a
truthy value. Disabling is only recommended for applications using exit
/ die
to prevent unavoidable notices.
Async applications
Fiber support - automatic context propagation to newly created fibers
Requires an NTS build, ext-ffi
, and setting the environment variable OTEL_PHP_FIBERS_ENABLED
to a truthy value. Additionally vendor/autoload.php
has to be preloaded for non-CLI SAPIs if ffi.enable
is set to preload
.
Event loops
Event loops have to restore the original context on callback execution. A basic implementation could look like the following, though implementations should avoid keeping unnecessary references to arguments if possible:
Contributing
This repository is a read-only git subtree split. To contribute, please see the main OpenTelemetry PHP monorepo.
All versions of context with dependencies
symfony/polyfill-php80 Version ^1.26
symfony/polyfill-php81 Version ^1.26
symfony/polyfill-php82 Version ^1.26