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 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

Technical Evaluation

Architecture fit. correlation-ids is a small, Laravel-specific library that attaches a correlation ID to the request lifecycle and makes it available to logs and outbound calls. Architecturally this is the right shape for a service-oriented Laravel estate: a middleware generates or accepts an inbound X-Correlation-ID (or similar), a Monolog processor stamps it onto every log record, and a Guzzle middleware forwards it downstream. That is the standard three-point contract for request tracing short of full distributed tracing, and it composes cleanly with a monolith or a modest microservice mesh.

Integration feasibility. The package is a straightforward Composer dependency (composer require manomano-tech/correlation-ids), registers a service provider, and expects middleware to be added to the HTTP kernel. There is no infrastructure prerequisite — no agent, no collector, no external service. The friction is entirely version-related: the last release is September 2018, which places it firmly in the Laravel 5.5–5.7 / PHP 7.0–7.2 era and Guzzle 6. A modern Laravel 10/11 application on PHP 8.2 will almost certainly fail composer install on illuminate/* and php constraints alone, before any runtime issues.

Technical risk. High, and concentrated in ownership rather than complexity. The repository is archived, has 3 stars, 0 dependents, and no commits in roughly seven years. There is no security patch path, no PHP 8 compatibility work, and no maintainer to escalate to. Concretely, expect to deal with: deprecated Laravel helpers removed in 6.0+, Monolog 1.x Logger::addRecord signatures that changed in Monolog 2 and 3, Guzzle 6 handler stacks that are incompatible with Guzzle 7's Middleware::mapRequest, and PHP 8 reserved-word and type-coercion changes. None of these are individually hard; collectively they mean the package cannot be consumed as a dependency and must be treated as reference source.

Key questions. (1) Does the team actually need a bespoke correlation ID, or does the platform already emit one — Laravel 8+ ships a Context facade, and most APM vendors (Datadog, Sentry, New Relic) inject their own trace ID? (2) Is there an OpenTelemetry or W3C traceparent requirement on the roadmap? If so, a proprietary X-Correlation-ID becomes a migration liability rather than an asset. (3) Does correlation need to survive queue dispatch and job retries, or is synchronous request-scoped tracing sufficient? (4) Which outbound clients exist beyond the default Guzzle stack — SDKs, SOAP clients, raw cURL — and will they all be covered?

Integration Approach

Stack fit. Laravel only. The package is bound to illuminate/support, illuminate/http, and Laravel's middleware/kernel conventions; it does not port to Symfony, Slim, or framework-agnostic PSR-15 without a rewrite. If the estate is heterogeneous, this solves one framework's slice of the problem.

Migration path. Do not add it as a Composer dependency. Vendor the source into an internal package (or a app/Support/CorrelationId namespace) under your own ownership, then modernise: bump constraints to the current Laravel/PHP matrix, replace removed helpers with their current equivalents, port the Monolog processor to Monolog 3's ProcessorInterface, and rewrite the Guzzle integration as a Middleware::mapRequest closure. Where the original used a static/singleton ID holder, prefer Laravel's Context facade so the ID flows into framework-generated logs for free and survives Context::add semantics in queued jobs.

Compatibility. Verify against the actual matrix before committing: PHP 8.1–8.3, Laravel 10/11, Monolog 3, Guzzle 7. If the organisation still runs a Laravel 8 LTS island, maintain a second branch or accept divergence. Also confirm the header name with any API gateway or load balancer in front of the service — the gateway may already mint a request ID and strip unknown headers, in which case the middleware must read that header rather than generate its own.

Sequencing. (1) One-day spike: clone, attempt install against a current skeleton, quantify the breakage. (2) Decision gate on build-vs-adopt — the functional surface is roughly 100–150 lines, so internal implementation is a credible alternative to forking. (3) If proceeding, fork and modernise behind an internal package name. (4) Land in a single non-production service, validate log correlation end-to-end including one async job. (5) Roll out service by service; align header naming and traceparent emission with the platform observability standard before broad adoption, not after.

Operational Impact

Maintenance. Effectively 100% internal from day one. Upstream is archived, so every future PHP or Laravel major bump lands on your team. The good news is that the code surface is tiny — steady-state maintenance is likely a few hours per framework upgrade, not a standing commitment. The bad news is that it is another internal package to track in the dependency inventory, and its low visibility means it will be forgotten until it breaks a build.

Support. No vendor, no community, no CVE feed. Any incident traced to the correlation middleware is debugged by whoever owns the fork. Document the internal owner explicitly; a 3-star archived package with no named maintainer is exactly the kind of thing that becomes orphaned after one reorg.

Scaling. Runtime cost is negligible — one header read, one string allocation, one log field per record. Two real scaling considerations: log volume grows with the extra field (trivial, but it is a field on every line, so structured-logging cardinality budgets should account for it), and header propagation must be consistently applied across every service or the correlation chain breaks at the first hop that drops it, which degrades the value of the whole investment as the estate grows.

Failure modes. Inbound header absent → middleware generates a fresh ID, which is correct but silently severs the chain from the caller; alert on generation rate. Conflicting or duplicated headers across a proxy chain → ambiguous correlation; normalise at the edge. Queue jobs that capture the ID at dispatch but reuse it across retries → all retry attempts collapse into one correlation ID, hiding retry storms. Outbound clients outside the Guzzle stack → untraced calls that appear as gaps. Log processor ordering → if the correlation processor runs before the context is populated, records ship without the field. None are catastrophic; all are the kind of quiet gaps that erode trust in the data during an incident.

Ramp-up. Low for engineers — the concept is familiar, the code is readable, and a mid-level developer can understand and extend the fork in under a day. The ramp-up cost sits with the TPM and platform team: deciding the header contract, aligning with the observability roadmap (OpenTelemetry/traceparent), and socialising the naming convention across service owners. Budget a sprint for the modernisation and pilot, and treat the package as a reference implementation and design input rather than a dependency to adopt as-is.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin