- Is m6web/statsd-request-headers-bundle compatible with Laravel?
- No, it is a Symfony bundle, not a Laravel package. It relies on Symfony HttpKernel, EventDispatcher, and DI conventions, so Laravel will not auto-register it or run it as native middleware. Treat it as a reference implementation rather than a Composer dependency for a Laravel app.
- Can I install m6web/statsd-request-headers-bundle in a Laravel project with Composer?
- Composer may resolve it, but installation does not make it a working Laravel integration. The bundle expects Symfony bundle registration and older Symfony/PHP assumptions from the 2016 era. Direct use should be time-boxed as a spike, not added to the production dependency graph.
- What does m6web/statsd-request-headers-bundle actually do?
- It captures incoming HTTP request headers and forwards them as metrics to StatsD. The goal is visibility into header usage and client behavior across an application. In a Laravel context, that behavior is better implemented as HTTP middleware with a maintained StatsD client.
- How do I send request header metrics to StatsD from Laravel middleware?
- Create middleware that reads an explicit allowlist of headers from the request and emits counters, gauges, or tags through a maintained StatsD client. Keep metric names stable, apply sampling, and gate the middleware by environment and configuration. Avoid emitting raw values unless there is a reviewed need and a cardinality budget.
- Which request headers should I allowlist for StatsD metrics in Laravel?
- Allowlist only headers tied to a concrete business or observability question, such as a client or device identifier when it is safe to emit. Never emit authorization, cookie, API key, session, or other secret-bearing headers. Prefer presence counters or bounded categories over raw values, and document the allowlist.
- Is m6web/statsd-request-headers-bundle maintained and safe for production?
- The repository is marked deprecated and the last release was in 2016, with no active maintenance signal. Direct production use would make the team responsible for an archived Symfony dependency. For Laravel, a small team-owned middleware port is the safer and clearer path.
- What are alternatives to m6web/statsd-request-headers-bundle for Laravel?
- The practical alternative is Laravel HTTP middleware plus a maintained StatsD client, configured with an allowlist, metric prefix, sampling, and environment gating. If you need broader tracing, evaluate OpenTelemetry or your existing APM/middleware standard instead of a deprecated Symfony bundle. Choose the option that fits your current metrics backend and cardinality budget.
- How do I avoid high cardinality when sending request header metrics to StatsD?
- Do not send raw header values or unbounded identifiers as metric names or tags. Normalize values into a small set of categories, or emit presence counters when values are not needed. Define a cardinality budget with the backend team and test metric volume in staging with sampling enabled before rollout.
- Does the bundle support modern PHP and Laravel versions?
- The package's Symfony-version assumptions are from the 2016 era, and compatibility with modern PHP or Laravel is uncertain and likely poor. Laravel version support is not a meaningful target because the package is not a Laravel package. Validate any spike against your exact Laravel, PHP, StatsD client, and backend versions.
- How should I test a Laravel StatsD request-header middleware implementation?
- Unit-test the allowlist and value-transformation logic with fake requests, and feature-test that only permitted headers produce metrics. Use a fake or in-memory StatsD client in tests, then run a staging spike with sampling to compare metric volume and utility. Include negative tests for secrets, PII, and unbounded values.