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 Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Archived, last release 2018-09-29. No security patches, no PHP 8.x support, no Symfony 5/6/7 support. Composer constraint resolution against a modern stack will fail or force old transitive dependencies.
  • Zero stars, zero dependents. No evidence of production use outside the originating organisation, no issue history to mine for edge cases, no community to inherit maintenance from.
  • Bus factor of one organisation, now disengaged. The upstream core library is in the same position; if we depend on it we inherit the same abandonment.
  • Unknown header/propagation semantics. Whether it follows any convention (W3C 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.

  1. What header name(s) does it read and write, and does it honour an inbound ID or always regenerate?
  2. Does the ID survive across queued jobs, console commands, and long-running workers — or is it request-scoped only?
  3. Does the core library depend on PSR-7/PSR-15 interfaces (portable) or on Symfony HTTP Foundation/HttpClient (not portable)?
  4. What is our actual target — a simple correlation ID, or full distributed tracing? If the latter, this package is a stepping stone at best and OpenTelemetry is the destination.
  5. Do we already have a logging pipeline (ELK, Datadog, Loki) where a correlation_id field is indexed and filterable? If not, the effort buys nothing.

Integration Approach

Stack fit. The bundle's responsibilities map cleanly onto native Laravel primitives, and the rewrite is genuinely small:

  • Inbound: a global middleware that reads the correlation header, validates/normalises it, generates a UUIDv4 when absent, and binds it into the container as a scoped singleton. Attach it to the response so clients can quote it in support tickets.
  • Logging: Laravel 11's Context facade (or a Monolog processor / Log::withContext() on older versions) so every record carries correlation_id without touching call sites.
  • Outbound HTTP: a 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.
  • Async: propagate via 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.

  1. Spike (½ day): read the bundle and core source; document the exact wire contract.
  2. Decide the standard (½ day): pick a header name and format, and align with platform/observability owners — this is a cross-team decision, not a local one. Strongly consider adopting W3C traceparent semantics now to avoid a second migration later.
  3. Implement inbound + logging (1–2 days): middleware, context binding, processor; ship behind a feature flag.
  4. Implement outbound + queue propagation (1–2 days): HTTP client middleware, job payload propagation, console command support.
  5. Validate end-to-end: two services, one request, confirm a single ID appears in both log streams.
  6. Decommission the reference: record the contract in an ADR so the next team does not rediscover this archived repo.

Operational Impact

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.

  • Broken continuity: a service that regenerates the ID instead of honouring an inbound one severs the chain silently. Test explicitly.
  • Missing propagation on async paths: the most common real-world failure — the ID is present in the web tier and absent the moment work hits a queue.
  • Context leakage in long-running workers: Laravel Octane and queue workers reuse processes; a scoped binding that is not reset will stamp the wrong ID on subsequent requests. This is the single most likely production incident from this feature.
  • Header spoofing / log injection: an unvalidated inbound header lets a caller inject arbitrary strings (including newlines) into our logs. Validate against a UUID regex and discard anything else.
  • Collision or weak generation: use a proper UUIDv4/v7 source, not 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.

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.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk