adgoal/statsd-client-bundle
Symfony bundle for monitoring via StatsD/Graphite using statsd-php-client. Provides a StatsD service/factory, Monolog handler, metric collectors (visitors, auth, SQL verbs, memory), and CLI commands to aggregate and flush metrics.
statsd service, CLI commands) via Laravel packages like statsd-php-client or custom wrappers.Container with Laravel’s Service Provider to register the StatsDClient.Monolog Handler for error metrics.Symfony\Component\DependencyInjection) may conflict with Laravel’s ecosystem. Mitigation: Use a composer install --ignore-platform-reqs or a custom wrapper.statsd-php-client directly.flush()) must be optimized to avoid blocking I/O.spatie/laravel-monitoring) or Prometheus clients for better fit?StatsDClient as a singleton, binding it to Laravel’s container.statsd() helper for convenience (e.g., StatsD::increment('user.signups')).Monolog Handler.statsd_exporter).ddtrace/laravel).statsd-php-client directly (bypassing the bundle) to validate core functionality.increment()/gauge() calls.App\Services\QueueStatsCollector).Monolog Handler with a Laravel Log Driver.Artisan).| Component | Symfony2 Bundle | Laravel Adaptation | Notes |
|---|---|---|---|
| StatsD Client | ✅ statsd service |
✅ Service Provider Binding | Use statsd-php-client directly if needed. |
| Monolog Handler | ✅ Log integration | ⚠️ Custom Log Channel | Requires Laravel 8.x+ log channel support. |
| Collectors | ✅ Modular | ✅ Service Classes | Reimplement as Laravel services. |
| CLI Commands | ✅ Artisan-like | ✅ Artisan Commands | Rename to php artisan statsd:flush. |
| Dependency Injection | Symfony DIC | Laravel Container | High risk; may need abstraction layer. |
orders.created).Monolog to forward errors to StatsD.flush() intervals to balance latency and load.composer.json or fork the repo.symfony/polyfill).statsd-php-client.
ping metrics).
app.{namespace}.metric) and aggregation.| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| StatsD Server Down | Metrics loss | Local buffering + retry logic. |
| Network Partition | UDP packet loss | Increase flush frequency or use TCP fallback. |
| Laravel App Crash | Unflushed metrics | Implement shutdown hooks to flush on exit. |
| Dependency Incompatibility | Integration breaks | Isolate in a separate service container. |
| Metric Explosion | StatsD/Grafana overload | Rate-limit collectors or use sampling. |
How can I help you explore Laravel packages today?