NestedFlowTracker
Zero-infra flow tracing for Laravel

See exactly where your Laravel business flows spend their time.

Wrap any block of code in a span. NestedFlowTracker times it and stores it as a tree — in your database. No collectors, no external backend, no data leaving your app. Works in production.

See the viewer →

PHP 8.1+ · Laravel 10 / 11 / 12 / 13 · MIT licensed · on Packagist

your-app.test/flow/bf03f57a…56e525c
The built-in viewer rendering a checkout flow as a timed tree: nested spans with duration bars and a failed span highlighted in red
The problem

You can see that it was slow. Not which step.

There's a gap between dev tooling and full observability stacks: production-safe tracing of your business logic, kept in your own database.

Telescope is dev-focused

Great in development, but it traces framework internals — queries, jobs, requests — not the steps of your flows.

OpenTelemetry needs infra

Powerful, but it wants collectors and a backend you have to stand up and operate before the first trace.

Hosted APM ships data out

Traces go to a third-party cloud and you're priced per event. Yours stay in a table you own and can query.


How it works

Wrap a block. Get a timed tree.

Wrap it

Flow::span('checkout', fn () => …) — closures auto-close and are exception-safe, so a span can't leak.

It records a tree

Nested spans become children; one flow can cross services via a shared trace id (W3C traceparent).

You read it

Enable the built-in viewer (FLOW_VIEWER=true) and open /flow — a collapsible timed tree with failed spans highlighted. No build step.

// wrap the flow you care about
use AdelinFeraru\NestedFlowTracker\Laravel\Facades\Flow;

$order = Flow::span('checkout', function () use ($cart) {
    Flow::span('charge card',   fn () => $gateway->charge($cart));
    Flow::span('reserve stock', fn () => $inventory->reserve($cart));
    return Flow::span('create order', fn () => Order::create($cart));
});
checkout ................. 312ms
├─ charge card ........... 188ms   ← there it is
├─ reserve stock ......... 41ms
└─ create order .......... 83ms
Why it's different

The space between Telescope and OpenTelemetry.

Production-safe, business-flow level, and your data never leaves your database.

Zero infrastructure

No collector, no separate backend. A Composer package and your existing database.

Production-safe

Records only what you wrap; HTTP & queue auto-instrumentation is opt-in. Disabled, the overhead is ~2µs per span.

Your business flows

You decide what's a span — not framework internals you didn't ask about.

Your data stays yours

Spans live in your database. Nothing is sent to a third party.

Grows with you

W3C trace-context across services + an optional OpenTelemetry export — scale up without being forced onto OTel infra.

Pluggable storage

database · log · null · otel drivers, plus a JSON API and the built-in viewer.

Get started

Trace your first flow in under 5 minutes.

Require the package, publish the migration, wrap a span, open /flow.

composer require adelinferaru/nestedflowtracker
php artisan vendor:publish --tag="flow-migrations"
php artisan migrate
# then set FLOW_VIEWER=true and visit /flow
PHP 8.1+Laravel 10 / 11 / 12 / 13MITBuilt-in viewer + JSON APIOTLP exportOn Packagist
Read the docs ↗
Copied to clipboard