inspector-apm/inspector-php
Inspector is a code execution monitoring tool for PHP developers. It tracks transactions and code segments in real time, alerts you when something goes wrong, requires PHP 8.1+, installs via Composer, and supports custom transports.
startTransaction, addSegment) turns vague roadmap items like "make checkout faster" into measurable targets: wrap the suspect block, get per-segment timing, and rank backlog items by real execution cost rather than intuition.TransportInterface escape hatch means we retain the option to swap the ingestion backend later without re-instrumenting the app — the strongest argument against building a bespoke tracer.registerGlobalHandler() (v3.16.7) gives unhandled-exception capture with a single call — a cheap reliability win for legacy endpoints that currently fail silently.fork() scopes (v3.17.0) are the differentiator: they create independent segment stacks per concurrent task, so Fibers, ReactPHP, or pcntl_fork workers don't corrupt parent-child relationships. This directly de-risks a roadmap bet on queue workers or event-loop services — without it, tracing async work is often actively misleading.Reasonable fit when:
Look elsewhere when:
For executives (CTO/VP Eng): This is a low-cost way to stop guessing about backend performance. We get production-grade tracing and error visibility on our Laravel services for the price of a composer dependency and an API key — no agents to operate, no platform migration. It is genuinely reversible: the client is MIT-licensed and supports a custom transport, so we can redirect the same instrumentation to another backend later without redoing the work. Recommendation: pilot on one high-traffic service with a clear success metric (for example, 20% faster mean time to diagnose a performance issue). If the pilot hits it, expand; if not, we've spent days, not a quarter.
For engineering leaders (tech leads/SREs): Three concrete problems it removes. First, async debugging: fork() scopes give interleaved Fibers and queue workers correct parent-child spans, which our current logging cannot do. Second, toil: addSegment() and global exception registration replace ad-hoc timing code and scattered try/catch logging. Third, exit risk: TransportInterface means we are not locked into the dashboard. Trade-offs to accept up front: PHP 8.1+ only, no cross-language tracing, and a small community footprint — so we own version pinning and keep the integration thin (wrap it behind our own facade so removing it is a one-file change). Next step: instrument one service, compare findings against current logs for two weeks, then decide.
For developers: Wrap anything suspicious in addSegment() and the dashboard tells you where the time went — no more microtime() archaeology. For queue and Fiber work, use fork() so concurrent tasks don't tangle the span tree. Setup is a composer require and an API key; the docs also expose an MCP endpoint so your editor assistant understands the API without you reading the source. Try it locally on a slow endpoint this week and tell us whether it found something our logs missed.
How can I help you explore Laravel packages today?