Search by

mammatus / open-telemetry

WyriHaximus

🕵️ Open Telemetry integration

Package info

github.com/MammatusPHP/open-telemetry

Language:Makefile

Type:composer-plugin

pkg:composer/mammatus/open-telemetry

Fund package maintenance!

WyriHaximus

Statistics

Installs: 5 238

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 4

0.1.0 2026-11-21 17:27 UTC

README

Open Telemetry integration

Continuous Integration Latest Stable Version Total Downloads Type Coverage License

Installation

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^.

composer require mammatus/open-telemetry

Fibers and tracing

This package propagates OpenTelemetry context across ReactPHP fibers and supports #[WithSpan] without enabling attribute hooks (which corrupt the Zend heap under fibers). See ADR 001 for the full design.

Bootstrap happens automatically via src/register.php (Bootstrap::once()).

Environment

Variable / ini Typical value Purpose
OTEL_PHP_FIBERS_ENABLED true on NTS, false on ZTS Native vs userland fiber context (docs)
opentelemetry.attr_hooks_enabled Off Use hook() for #[WithSpan] instead of attr hooks
OTEL_PHP_DISABLED_INSTRUMENTATIONS all in tests Disable auto-instrumentation noise in PHPUnit

Monkey-patch

On composer install, dependent packages that call React\Async\async are rewritten to Mammatus\OpenTelemetry\async so fiber context forks happen without code changes. See the ADR for trade-offs.

Todo

License

The MIT License (MIT)

Copyright © 2026 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.