manomano-tech/correlation-ids-bundle
A Symfony/PHP bundle for generating, propagating, and exposing correlation IDs across HTTP requests, logs, and downstream services. Helps trace requests end-to-end and improves observability in distributed systems.
Architecture fit. The first thing to flag is a framing mismatch: manomano-tech/correlation-ids-bundle is a Symfony bundle, not a Laravel package. It is the Symfony wiring layer around the framework-agnostic manomano-tech/correlation-ids core, and its job is narrow and well-understood: generate or accept a correlation ID per request, expose it to the application, attach it to log records, and propagate it on outbound HTTP calls. That concern is a perfect fit for a Laravel service — correlation IDs are the cheapest available lever for making distributed logs queryable — but the artifact is not installable in Laravel and cannot be used as-is. Conceptually compatible, mechanically incompatible.
Integration feasibility. Low as a dependency, high as a reference implementation. The bundle almost certainly does three things we would otherwise write ourselves: a kernel request listener (read X-Correlation-ID or similar from inbound headers, generate a UUID if absent, stash it in a request-scoped service), a Monolog processor that stamps the ID onto every record, and a client-side decorator that re-emits the header downstream. Each of those has a direct, idiomatic Laravel counterpart. The realistic path is a 100–200 line internal implementation inspired by the package's behaviour, not a Composer require.
Technical risk. Material, and mostly about provenance rather than code quality:
traceparent, X-Request-ID, X-Correlation-ID) needs to be read out of the source before we commit to a wire format that other services must honour.Key questions for the spike.
correlation_id field is indexed and filterable? If not, the effort buys nothing.Stack fit. The bundle's responsibilities map cleanly onto native Laravel primitives, and the rewrite is genuinely small:
Context facade (or a Monolog processor / Log::withContext() on older versions) so every record carries correlation_id without touching call sites.Http::globalMiddleware() that injects the header onto every Guzzle/Laravel-client request — this is the piece teams most often forget, and its absence silently breaks trace continuity across service boundaries.Queue::createPayloadUsing() or a queued-job trait so the ID crosses the worker boundary; this is where a naive port of a Symfony request listener falls down.Migration path. Do not port the bundle. Read it, extract the behavioural contract (header names, generation rules, propagation points), and implement natively. If the core correlation-ids library turns out to be PSR-3/PSR-15 based and framework-neutral, vendoring it as a dependency is defensible — but pin it, fork it, or copy the ~few hundred lines into our own namespace. Given the archive status, copying is cheaper than owning a fork.
Compatibility. Verify PHP constraint and PSR dependencies before any code-level reuse; the 2018 vintage implies PHP 7.1–7.2 era and Symfony 3/4. Nothing there will run on PHP 8.2+ without edits. Our own implementation should target whatever PHP/Laravel versions we currently support and be covered by tests, which the original cannot offer us.
Sequencing.
traceparent semantics now to avoid a second migration later.Maintenance. This is the dominant cost driver. An archived package cannot be patched, so any adoption means we own the code — and if we own it, we should own it in our own repository rather than as a pinned third-party dependency. A vendored fork of an abandoned 2018 package will be flagged by every SCA/dependency scanner we run and will require a documented exception. Reimplementing avoids that entirely and is likely less total effort than the exception process.
Support. Zero community support, no upstream maintainer, no CVE response path. Internal ownership must be assigned explicitly at adoption; "the platform team wrote it" is not a support model. Because the surface area is small, this is manageable — but it must be a conscious assignment, not an accident.
Scaling. Runtime cost is negligible: one UUID per request and a string on each log line. The real scaling concerns are downstream — log volume grows with request volume (the ID adds bytes to every record), and high-cardinality correlation_id fields can stress index configurations in some logging backends. Neither is a blocker at typical SaaS volumes, but both should be raised with whoever owns the logging platform before rollout.
Failure modes to design against.
uniqid() or rand().Ramp-up. Low technical difficulty — a mid-level engineer can implement and test the full feature in a few days. The harder ramp-up is organisational: agreeing a header convention across service owners, wiring the logging backend to index and surface the field, and teaching support staff to ask customers for the ID. Budget more time for the cross-team agreement than for the code. If the organisation has any ambition toward distributed tracing, the strategic recommendation is to skip correlation IDs as an end state and go directly to OpenTelemetry, where correlation IDs are a degenerate subset of trace context — the archived bundle is best used as a justification for that decision rather than as a component in it.
How can I help you explore Laravel packages today?