Download the PHP package niladam/laravel-tracing without Composer

On this page you can find all versions of the php package niladam/laravel-tracing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-tracing

Laravel TracingA request traced through its jobs and the services they call, every log line carrying the same trace id

Latest Version on Packagist Tests Code Style Total Downloads

One id follows a request through its own log lines, the queued jobs it dispatches, the jobs those dispatch, and the internal services it calls.

Built on the W3C Trace Context standard, so it speaks the same traceparent header as OpenTelemetry, Sentry, Datadog and Honeycomb — no APM dependency required, and nothing to rewrite if you add one later.

grep one trace_id for the whole tree. parent_span_id tells you who triggered what.

Installation

That is the whole setup — the provider is auto-discovered, requests are traced, jobs inherit the trace and log lines carry it. Publish the config only when you want to change something:

What you get without configuring anything

Key
trace_id 32 hex. The root, minted once at the origin and never regenerated as it travels.
span_id 16 hex. This one unit of work — this request, this job run, this command.
parent_span_id The span_id that caused this one. null at the root.
channel http, console or queue.
user_id The moment any guard answers — session and stateless alike.
ip, url, method On a request.
command On a console command.
job.* name, connection, queue, attempts, uuid — inside a job.

Crossing every boundary on the way:

Boundary How
Inbound HTTP Reads traceparent / tracestate and continues the caller's trace
Queued jobs Context dehydrate/hydrate, with a fresh child span per job run
Console subprocesses Laravel rehydrates __LARAVEL_CONTEXT, so Artisan::call children join in
Outgoing HTTP traceparent injected on your own hosts only — never a third party
Saloon Registered separately, since it ships its own sender. Optional.
Logs Merged into each record's context, so a line stays one JSON object

Adding your own context

Every key has a moment — the instant it becomes true. Record it then and you never think about middleware order or whether the user has logged in yet.

Pick the lightest rung that fits:

Your key is… Do this
a constant context.additional in config — no code
a value or two, computed Tracing::always(…)
tied to who is logged in Tracing::authenticated('web', …)
tied to a moment Tracing::on(SomeEvent::class, …)
growing, or needs dependencies a Recorder class listed in record

That last line is the part a middleware cannot do: Context::add overwrites, so the key corrects itself the moment the team changes. Snapshot it once at the start of a request and it is wrong for the rest of it.

Anything you put in Laravel's own Context is traced too — there is no second store and nothing new to learn:

Read the trace back through the facade, which knows what you have named the keys:

Keeping secrets out

Four mechanisms, narrowest first — the guide covers which to reach for:

Documentation

Recording context The moments, the built-in recorders, and plugging in your own
Adding your own context Using Laravel's Context — anywhere, any time, including mid-job
Registering the middleware Groups, global, or a route alias — plus ordering and manual wiring
Jobs Child spans, job.* context, and opt-in job arguments
Keeping secrets out #[\SensitiveParameter], hidden context, redaction, and your queue
Handing the trace back Response headers, and showing an id to a user
Interoperability The wire format, renaming keys, upstream ids, Saloon, APMs

Configuration at a glance

Five groups, each answering one question:

'enabled' => false turns the lot off.

Requirements

PHP 8.2+ (8.3+ on Laravel 13) tested
Laravel 12 ^12.1 tested
Laravel 13 ^13.0 tested
Saloon ^4.0, optional tested, and tested absent

The floors are where the APIs this package needs first appeared, nothing more. Keeping your framework patched is your application's business and composer audit's — a package that pins a security floor only goes stale on the next advisory.

Why not Laravel 11

Illuminate\Contracts\Log\ContextLogProcessor arrived in v12.1.0 — it exists in no Laravel 11 release. Without it there is no supported way to put the trace on a log record, which is most of what this package does, so Laravel 11 is not a matter of testing effort: there is nothing to hook into. That is also why the Laravel 12 floor is ^12.1 rather than ^12.0.

Saloon v3 is unsupported for a different reason: every release carries an unpatched advisory (<4.0.0), so there is no safe floor to point at.

Testing

Changelog

See CHANGELOG.md.

Credits

The logo and header image were generated with AI.

License

MIT. See LICENSE.md.


All versions of laravel-tracing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.1|^13.0
illuminate/http Version ^12.1|^13.0
illuminate/log Version ^12.1|^13.0
illuminate/routing Version ^12.1|^13.0
illuminate/support Version ^12.1|^13.0
monolog/monolog Version ^3.0
psr/http-message Version ^1.1|^2.0
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package niladam/laravel-tracing contains the following files

Loading the files please wait ...