- Is m6web/statsd-bundle a Laravel package?
- No. It is a Symfony bundle that ships a Bundle subclass, a dependency injection extension, tagged-service collectors, and kernel event subscribers wired through symfony/framework-bundle and symfony/dependency-injection. Running composer require m6web/statsd-bundle in a Laravel app will pull Symfony HttpKernel, DI, and Config components, but nothing will boot the bundle. If you want this functionality in Laravel, extract the StatsD client wrapper and collector pattern into a first-party package instead of installing the bundle.
- How do I install and configure m6web/statsd-bundle in Symfony?
- Install it with composer require m6web/statsd-bundle, register the bundle in your kernel bundles file, then configure the connection under the statsd key in your Symfony configuration. You typically set the host, port, and namespace once, and the bundle exposes the client as a service you can inject. Check the README for the exact configuration tree and service ID, since the bundle is maintained by a single organization and documentation is limited.
- Can I use m6web/statsd-bundle to send counters, gauges, and timings?
- Yes. The bundle wraps an M6Web StatsD client that supports counters, gauges, timings, and sets over UDP. You inject the service wherever you need instrumentation and call the corresponding methods, without wiring the connection yourself. Metrics are fire-and-forget, so no exception is raised if the daemon or network is down.
- Does m6web/statsd-bundle work with PHP 8.3, PHP 8.4, Laravel 11, or Laravel 12?
- Laravel support is not applicable because this is a Symfony bundle, not a Laravel package. PHP 8.3 and 8.4 compatibility is unverified: the last release was 2023-08-09, which predates recent Symfony majors, so test carefully before upgrading. If you only extract the client class into your own package, the platform risk largely disappears.
- What are the alternatives to m6web/statsd-bundle?
- For a thin transport, consider league/statsd or a domnikl/statsd-style UDP client, which you can wrap in a Laravel service provider with a config file. If your organization standardizes on OpenTelemetry or Prometheus, those SDKs may make StatsD a second-class citizen and double your maintenance surface. For Symfony, alternative StatsD bundles exist, but check release dates and maintainer activity before adopting any of them.
- Is m6web/statsd-bundle still maintained?
- Maintenance is effectively single-organization: BedrockStreaming publishes it, it has roughly 55 stars and no dependents, and the last release was 2023-08-09. There is no broader community to inherit fixes, so assume you own the code once you adopt it. The MIT license makes forking or vendoring legally clean.
- How do I test code that uses m6web/statsd-bundle without a StatsD daemon?
- Define a narrow interface for your metrics calls and bind an in-memory or no-op implementation in the test container, then assert on the recorded increments, gauges, and timings. The bundle's UDP transport swallows errors, so a real daemon is unnecessary for unit tests. Keeping your assertions behind your own interface also means you can swap the underlying client later without rewriting tests.
- How do I instrument request timing with StatsD in a Laravel application?
- Do not try to port the bundle's event subscribers directly; instead implement terminable middleware. Start a timer in handle(), then emit the timing metric and a status-code counter in terminate() so metrics never block the response. Bind a singleton StatsD client through a service provider with a published config/statsd.php containing host, port, prefix, sample rate, enabled, and global tags.
- Which StatsD backend should I target with this bundle?
- Decide up front whether the target is vanilla StatsD with Graphite or a tagged backend such as DogStatsD or Telegraf, because tag semantics change the metric API surface and your cardinality budget. Shipping to two sinks doubles the maintenance surface, so pick one primary destination for v1. A thin client plus explicit increment() and timing() calls is often enough before adopting a full collector or tagging model.
- What are the production risks of using StatsD over UDP?
- StatsD is fire-and-forget over UDP, so errors are swallowed and a broken pipeline looks identical to a healthy one until dashboards go flat. Add a synthetic check on the metrics pipeline itself and assign a named owner for the instrumentation code, because metric coverage decays silently over time. Also keep payloads small and consider sample rates to avoid dropped packets under load.