- How do I install the inter-app request identifier package in a Laravel app?
- Install it with Composer using composer require juliendufresne/inter-app-request-identifier. Then register the package middleware for incoming requests and publish or adjust the package configuration if the README provides a config file. Because the package is early-stage, follow the repository instructions for your Laravel version rather than assuming a fixed installation path.
- How does the package assign and forward request identifiers between applications?
- The middleware assigns a unique identifier to each inbound request, typically using a configurable HTTP header. On outgoing HTTP calls, the package can forward that same identifier so downstream Laravel applications receive and reuse it. This creates a shared correlation value across services for the duration of a user action.
- Which Laravel versions are supported by juliendufresne/inter-app-request-identifier?
- The provided package overview does not specify supported Laravel versions. Check the composer.json constraints and README on the repository or Packagist before installing. Since the package is described as lightweight and early-stage, test it against your application's Laravel and PHP versions.
- Can I change the HTTP header used for the request identifier?
- Yes, the header name is configurable according to the package overview. You can align it with an existing convention such as X-Request-ID or a custom internal header. Make sure every service in the chain uses the same configured header name for correlation to work.
- Does it forward the request ID with Laravel's HTTP client and Guzzle?
- The package is designed to forward the identifier on outgoing HTTP calls so downstream services can correlate requests. The overview does not document every client integration detail, so verify whether it hooks into Laravel's HTTP client, Guzzle, or both. Test a real outgoing request in your setup to confirm the header is present.
- How do I read the current request ID in Laravel code?
- The current identifier is exposed through a simple helper and a facade. Use those APIs in controllers, jobs, or logging context instead of reading the raw header directly. This keeps your code consistent if the header name or generation strategy changes.
- Is this package a replacement for OpenTelemetry or full distributed tracing?
- No, it provides a shared request identifier for log and error correlation, not a complete tracing system. It does not claim to collect spans, sampling decisions, or export traces to a backend. It suits simple service-to-service correlation where a full distributed tracing stack is unnecessary.
- How should I test that the request identifier is propagated between services?
- Write a feature test that sends an inbound request and asserts the middleware assigns or preserves the configured header. For outgoing calls, use Laravel's HTTP client fakes or a test double and assert the forwarded header value. Also test the case where no inbound identifier exists to confirm generation works.
- What are the production considerations for using a shared request ID header?
- The middleware is lightweight, but you should decide whether to trust inbound identifier headers from clients or only from trusted upstream services. If clients can spoof the header, validate or overwrite it at the edge. Also ensure your logging and error reporting include the identifier so the correlation value is actually useful.
- Is this package actively maintained, and what alternatives exist?
- The context lists the repository as unknown and describes the package as early-stage and lightweight, so check Packagist and the source repository for recent releases and issues. Alternatives include custom Laravel middleware for request IDs, other correlation ID packages, or full tracing tools such as OpenTelemetry. For production use, review maintenance activity and compatibility before adopting it.