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

Request Id Laravel Package

snowflake/request-id

Laravel package that attaches a unique request ID to every incoming request, exposes it through response headers and a helper, and makes it available to logs so you can trace, correlate, and debug requests across services and distributed systems.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability roadmap sequencing. A request-ID header is the cheapest first step toward correlated logs and traces. It supports a decision to ship basic correlation IDs now while deferring full distributed tracing (OpenTelemetry, span propagation) to a later quarter.
  • Build vs. buy vs. borrow. The package’s entire surface area is a middleware that generates a UUID and attaches it to request/response headers. This is a useful forcing function for the build-vs-buy conversation: at ~20–40 lines of code, the honest answer is usually build, and the package serves mainly as a reference implementation or a stopgap.
  • Support and incident-response tooling. Exposing a request ID in error responses and support-facing surfaces lets customers quote an ID that maps directly to a log line. This unlocks decisions about support workflow (ticket templates, admin lookup tools) and reduces mean time to resolution.
  • API contract and client-experience decisions. Committing to an X-Request-ID (or W3C traceparent) header is an externally visible API contract. That decision affects documentation, SDKs, gateway configuration, and any partner integrations that want to correlate their calls with your logs.
  • Platform standardization. If multiple services or teams are involved, this is where you decide on a single correlation-ID convention and enforce it at the edge (gateway/load balancer) so every downstream service inherits it.
  • Vendor and dependency risk posture. With zero stars and zero dependents, adopting this package is itself a product decision about acceptable supply-chain risk for infrastructure-level code — a category where you generally want boring, well-maintained dependencies or none at all.

When to Consider This Package

Consider it when:

  • You run a Symfony application and want request correlation IDs with near-zero effort. Note the mismatch: despite being framed as a Laravel/PHP package, this repository is a Symfony bundle. Laravel teams would need equivalent middleware (Illuminate\Http\Middleware with a Request::header check) and should treat this repo as a pattern, not a drop-in.
  • You have no APM or tracing vendor in place and need a fast, low-cost way to correlate application logs with a specific customer request.
  • You want a reference implementation to validate the shape of a request-ID middleware before writing your own.
  • You need to demonstrate the concept in a spike or prototype where correctness of dependency maintenance is not yet a concern.

Look elsewhere (or build in-house) when:

  • You need real distributed tracing: span creation, context propagation across queues and HTTP clients, sampling, W3C Trace Context compliance. Reach for OpenTelemetry (open-telemetry/opentelemetry-php) or your APM vendor’s SDK instead.
  • Maintenance risk matters — which, for infrastructure middleware, it usually does. Zero stars and zero dependents means no community validation, no security review, no guarantee of PHP-version compatibility. You are effectively adopting an unmaintained dependency.
  • Your gateway or ingress already injects a request ID; adding a second generator creates conflicting IDs and undermines the whole point of correlation.
  • You need async/queue support — a request ID generated per HTTP request says nothing about jobs dispatched from it; propagation into workers is a separate design problem this package does not address.

How to Pitch It (Stakeholders)

For executives: This is a small, low-cost capability with a direct line to support economics and incident response. Today, when a customer reports a failure, engineering searches logs by timestamp and guesswork. Attaching a unique ID to every request — and surfacing it to the customer — turns that into a single lookup. Expect faster resolution of support tickets and cleaner post-incident analysis, at roughly the cost of a few hours of engineering. It is not a monitoring platform; it is the plumbing that makes monitoring useful, and it is a prerequisite for any serious tracing investment later.

For engineering: The pattern is a thin middleware that reuses an inbound X-Request-ID if present, otherwise generates one, attaches it to the response, and pushes it into the logger’s context so every log line for that request is correlatable. My recommendation is to implement this in-house rather than depend on this specific package: the code is trivial, the repository shows no adoption or maintenance signal, and infrastructure middleware is the wrong place to take on unvetted supply-chain risk. Treat the package as a design reference. While we are in here, standardize the header name and inject it at the edge so downstream services inherit it — and flag the follow-on work of propagating the ID into queued jobs, which is the part people forget and then can’t debug their async failures.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core