spatie/laravel-disk-monitor
Monitor Laravel filesystem disks by recording daily metrics (currently: file count per disk). Includes migrations, config for disk names, and a scheduled command to capture usage over time for reporting and alerts.
config/filesystems.php), ensuring minimal disruption to existing architecture.config/disk-monitor.php, allowing selective monitoring.DiskMonitored) for post-processing (e.g., logging, notifications), enabling integration with existing alerting systems.spatie/laravel-monitoring or custom scripts) with active support?\Illuminate\Filesystem\FilesystemManager), requiring no changes to existing disk configurations.Monolog) or monitoring tools (e.g., Datadog, Sentry).spatie/laravel-slack-notification or custom webhooks.config/filesystems.php to identify disks to monitor.composer require spatie/laravel-disk-monitor
php artisan vendor:publish --provider="Spatie\DiskMonitor\DiskMonitorServiceProvider"
config/disk-monitor.php to specify disks and thresholds.s3 and local disks with alerts at >10,000 files.DiskMonitored events in an event listener or job:
public function handle(DiskMonitored $event) {
if ($event->files > 10000) {
// Trigger alert (e.g., Slack, PagerDuty).
}
}
php artisan disk:monitor (e.g., daily).spatie GitHub for forks or updates.DiskMonitored events for debugging.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package incompatibility | Broken monitoring | Fork or replace with an alternative. |
| Filesystem permission issues | Silent failures | Log errors and set up monitoring for the tool. |
| Alert fatigue (too many triggers) | Ignored alerts | Start with conservative thresholds. |
| High scan latency | Slow cron jobs | Schedule scans during off-peak hours. |
| Dependency conflicts | Deployment blocks | Isolate in a separate service if needed. |
How can I help you explore Laravel packages today?