Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Correlation Ids

Correlation Ids Laravel Package

manomano-tech/correlation-ids

Correlation IDs for Laravel: generate a unique ID per request and propagate it through logs, HTTP clients and queued jobs so you can trace a single action across services. Lightweight middleware and helpers make setup quick with minimal configuration.

View on GitHub
Deep Wiki
Context7

Giving request correlation capabilities to your project

Frequently asked questions about Correlation Ids
How do I install manomano-tech/correlation-ids in a Laravel app?
Install it with composer require manomano-tech/correlation-ids, then register the package service provider and add its middleware to the HTTP kernel. That flow matches the Laravel 5.5-era README, but on modern Laravel and PHP versions Composer will likely reject the package because its illuminate/* and php constraints are from 2018. If you only need the behavior, vendor the source into your app instead of adding it as a dependency.
Does manomano-tech/correlation-ids support Laravel 10 or Laravel 11?
No. The last release was September 2018 and targets Laravel 5.5 through 5.7 with PHP 7.0 through 7.2, so Laravel 10 and 11 are outside its compatibility matrix. Composer install will usually fail on illuminate/* or php constraints before runtime. Treat the code as reference material and port the middleware, Monolog processor, and Guzzle integration to current APIs.
How does correlation-ids propagate a correlation ID through logs and HTTP clients?
The package uses middleware to generate or accept an inbound correlation ID, a Monolog processor to stamp that ID onto every log record, and a Guzzle middleware to forward it to downstream services. That three-point contract covers request logs and outbound HTTP calls. It is not full distributed tracing, so you still need to decide how the ID is stored and forwarded in other clients.
Does correlation-ids propagate correlation IDs to queued jobs?
The package is described as supporting queued jobs, but in practice the ID must be serialized into the job payload or stored in a request-scoped context that the worker can read. The original code predates Laravel's Context facade, so modern queue propagation usually requires custom work. Verify job retries and dispatch paths explicitly if trace continuity matters.
What PHP, Laravel, Monolog, and Guzzle versions does correlation-ids require?
As published, it fits the Laravel 5.5 to 5.7 era, PHP 7.0 to 7.2, Monolog 1.x, and Guzzle 6. Those versions are long past end of life and are incompatible with Laravel 10/11, PHP 8.1+, Monolog 3, and Guzzle 7 without changes. Any modernization should update the Monolog processor to ProcessorInterface and rewrite the Guzzle integration as Middleware::mapRequest.
Is manomano-tech/correlation-ids maintained and safe for production?
The repository is archived, has roughly 3 stars, no dependents, and no commits in about seven years. There is no maintainer, no security patch path, and no PHP 8 compatibility work. For production, do not consume it as a Composer dependency; vendor and own the code, or use Laravel Context plus OpenTelemetry or your APM vendor's trace ID.
Can I use correlation-ids with OpenTelemetry or W3C traceparent?
Not directly. The package is built around a proprietary correlation header such as X-Correlation-ID, while OpenTelemetry and W3C use traceparent and tracestate. If distributed tracing is on your roadmap, adopting OpenTelemetry is the safer long-term choice. A custom correlation ID can become migration debt if it is not mapped to the standard trace context.
How do I configure the correlation ID header name in correlation-ids?
The middleware reads or generates an inbound header such as X-Correlation-ID and forwards it downstream, but the exact configuration key depends on the package source and README. Confirm the header name with your API gateway or load balancer first, because a gateway may mint its own request ID or strip unknown headers. If the gateway already supplies an ID, configure the middleware to read that header instead of generating a new one.
What are alternatives to manomano-tech/correlation-ids for Laravel?
Laravel 8+ includes the Context facade, which can carry a request ID into framework logs and queued jobs with less custom code. OpenTelemetry gives you W3C trace context, and APM tools such as Datadog, Sentry, and New Relic inject their own trace IDs. A small custom middleware plus a Monolog processor is also a reasonable replacement if you only need request-scoped correlation.
How do I test correlation IDs in Laravel feature tests?
Send a request with a known correlation header and assert that the same value appears in log records, response headers if you expose it, and outbound Guzzle requests. For queued jobs, assert the ID is serialized into the payload and restored in the worker. The original package has no test helpers, so feature tests should verify your middleware, logging processor, and HTTP client integration directly.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource