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.
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.Consider it when:
Illuminate\Http\Middleware with a Request::header check) and should treat this repo as a pattern, not a drop-in.Look elsewhere (or build in-house) when:
open-telemetry/opentelemetry-php) or your APM vendor’s SDK instead.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.
How can I help you explore Laravel packages today?