PHPackages                             d076/laravel-tracing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. d076/laravel-tracing

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

d076/laravel-tracing
====================

Tracing module for laravel

v0.3.1(1mo ago)287MITPHPPHP ^8.3CI passing

Since May 25Pushed 1mo agoCompare

[ Source](https://github.com/D076/laravel-tracing)[ Packagist](https://packagist.org/packages/d076/laravel-tracing)[ RSS](/packages/d076-laravel-tracing/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (8)Dependencies (24)Versions (9)Used By (0)

d076/laravel-tracing
====================

[](#d076laravel-tracing)

[![Tests](https://github.com/d076/laravel-tracing/actions/workflows/tests.yml/badge.svg)](https://github.com/d076/laravel-tracing/actions/workflows/tests.yml)[![PHP](https://camo.githubusercontent.com/c8d8dad6beb757a2b8acba331d16140813699543b88a37af0a81f20bd35f61de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d626c7565)](https://www.php.net)[![Laravel](https://camo.githubusercontent.com/88ce7f9ac798288a91de4918224da3cf354ffc092c40118a331bb5fa3c59f968/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3131253230253743253230313225323025374325323031332d726564)](https://laravel.com)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

A Laravel package for tracing inbound and outbound HTTP requests. Each inbound request gets a unique `X-Trace-Id` (UUID7); every outbound request made via the `Http` facade, plus any jobs and events dispatched from that request, **automatically** inherit the same `trace_id`.

Optionally ships a web UI at `/tracing` for browsing recorded requests.

Requirements
------------

[](#requirements)

- **PHP** 8.3+
- **Laravel** 11 / 12 / 13
- **Database**: PostgreSQL / MySQL / SQLite

Installation
------------

[](#installation)

```
composer require d076/laravel-tracing
```

Register the service provider in `bootstrap/providers.php`:

```
return [
    App\Providers\AppServiceProvider::class,
    D076\Tracing\Providers\TracingServiceProvider::class,
];
```

Run migrations:

```
php artisan migrate
```

Publish the config (optional):

```
php artisan vendor:publish --tag=tracing-config
```

Quick start
-----------

[](#quick-start)

Works out of the box with sensible defaults:

- synchronous recording of inbound and outbound requests to the database;
- masking for common secrets (`password`, `token`, `authorization`, `access_token`, etc.);
- `X-Trace-Id` header on every response;
- UI at `/tracing`, accessible only in the `local` environment by default;
- API rate limit of 120 req/min.

Key switches:

VariableDefaultPurpose`TRACING_ENABLED``true`Record inbound requests`TRACING_OUTGOING_ENABLED``true`Record outbound requests`TRACING_DRIVER``database``database` (sync) or `queue` (async via Horizon)`TRACING_UI_ENABLED``true`Web UI`TRACING_RETENTION_DAYS``30`Retention in days; cleaned via `php artisan model:prune`See [docs/configuration.md](docs/configuration.md) for the full reference.

UI authorization
----------------

[](#ui-authorization)

By default `/tracing` is accessible only in the `local` environment. In production, override the gate in `AppServiceProvider::boot()`:

```
use Illuminate\Support\Facades\Gate;

Gate::define('viewTracing', fn ($user) => $user?->isAdmin() ?? false);
```

Using trace\_id in your code
----------------------------

[](#using-trace_id-in-your-code)

```
use D076\Tracing\Context\TraceId;

Log::info('processing order', ['trace_id' => app(TraceId::class)->get()]);
```

Queued jobs require no setup — `trace_id` is automatically inherited from the parent HTTP request (see [docs/configuration.md → trace\_id propagation to jobs](docs/configuration.md#trace_id-propagation-to-jobs)).

Performance overhead
--------------------

[](#performance-overhead)

Measured with `phpbench` on a minimal testbench app, SQLite in-memory, no opcache (Docker, PHP 8.4):

ModeOverhead per requestBaseline (tracing disabled)—`TRACING_DRIVER=database`~+0.17 ms`TRACING_DRIVER=database` + `TRACING_STORE_RESPONSE_BODY=true`~+0.21 ms`TRACING_DRIVER=queue` (sync driver, worst case)~+0.31 ms> With a real async queue (Redis + Horizon), the main-request overhead for `TRACING_DRIVER=queue` drops to near zero — only job dispatch cost, while the actual DB write happens in the worker.
>
> Use `TRACING_DRIVER=queue` if latency matters; use a [separate database connection](docs/configuration.md#separate-database-for-tracing) if I/O isolation matters.

Documentation
-------------

[](#documentation)

- **[Architecture](docs/architecture.md)** — package components, lifecycle of inbound and outbound requests.
- **[Configuration](docs/configuration.md)** — full env reference, masking, rate limiting, async mode, route exclusions, trace\_id propagation to jobs, UI authorization.
- **[Database](docs/database.md)** — what is stored, table schemas, example SQL queries.

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

8

Last Release

43d ago

PHP version history (2 changes)v0.1.0PHP ^8.4

v0.2.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9625f3deb9354a1834ef911763c1ee6598527b532c34cd69d62495e3bbcb411?d=identicon)[D076](/maintainers/D076)

---

Top Contributors

[![D076](https://avatars.githubusercontent.com/u/33459398?v=4)](https://github.com/D076 "D076 (7 commits)")

---

Tags

laraveltracing

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/d076-laravel-tracing/health.svg)

```
[![Health](https://phpackages.com/badges/d076-laravel-tracing/health.svg)](https://phpackages.com/packages/d076-laravel-tracing)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M136](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k30.2M151](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k55.0M632](/packages/laravel-scout)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
