- Can I use benjamin-rqt/data-watcher-bundle in a Laravel application?
- No. benjamin-rqt/data-watcher-bundle is a Symfony bundle, not a Laravel package: it has no Laravel service provider, no Artisan commands, and no Composer Laravel auto-discovery. In a Laravel application you would need to port the check/notify/persist loop or build the equivalent with Laravel Scheduler, queued jobs, notifications, and an execution-history table.
- What does benjamin-rqt/data-watcher-bundle do?
- It is a Symfony bundle for database anomaly detection. You define SQL or Doctrine checks, run them manually or on a cron schedule, store execution history in a data_watcher_run table, and send Twig-templated email notifications when anomalies are detected.
- Which Symfony and PHP versions are supported by data-watcher-bundle?
- It requires PHP 8.2 or higher and supports Symfony 6.3, 7.0, and 8.0. It also depends on Symfony framework-bundle, messenger, mailer, twig-bundle, and scheduler, plus Doctrine DBAL 3 or 4.
- How do I install and register data-watcher-bundle in Symfony?
- Add a VCS repository entry for the GitHub URL, run composer require benjamin-rqt/data-watcher-bundle, and register DataWatcherBundle in config/bundles.php if Symfony Flex does not do it automatically. Then create config/packages/data_watcher.yaml and run php bin/console data-watcher:setup to create the history table.
- What Symfony components and Doctrine dependencies does data-watcher-bundle require?
- The hard requirements include Symfony framework-bundle, Messenger, Mailer, TwigBundle, Scheduler, Doctrine DBAL 3 or 4, and dragonmantank/cron-expression for cron triggers. doctrine/orm is optional and only needed if you extend AbstractDoctrineCheck.
- How do I configure email recipients and Messenger for scheduled data watcher checks?
- Configure from_email, recipients, and optionally app_name under data_watcher in config/packages/data_watcher.yaml. To run scheduled checks, configure a Messenger transport and route BenjaminRqt\DataWatcherBundle\Scheduler\Message\RunCheckMessage to it, then set MAILER_DSN and MESSENGER_TRANSPORT_DSN in your environment.
- How do I create a custom SQL or Doctrine check with data-watcher-bundle?
- Create a check class in your application, not in the bundle, by extending AbstractSqlCheck for raw SQL or the Doctrine check base when using doctrine/orm. Implement methods such as getName and the query/check logic, then register or run the check according to the bundle configuration.
- How is execution history stored and can I prune data_watcher_run?
- Execution history is stored in the bundle's custom data_watcher_run table, which you create with php bin/console data-watcher:setup. The provided README excerpt does not document retention limits or pruning, so confirm the schema and data volume before production and add pruning if your history grows too large.
- Can data-watcher-bundle send alerts to Slack, PagerDuty, or webhooks instead of email?
- The built-in alerting path is email through Symfony Mailer and Twig templates, as described in the overview. Slack, PagerDuty, webhook, or other channels are not described as built-in and would require custom notifier/check work or a separate integration.
- What are the maintenance and production risks of using data-watcher-bundle?
- The main risk is adoption and maintenance, not code design: it has very low public signal, single-maintainer ownership, no stable API contract, and a moving Symfony/DBAL compatibility matrix. Pin versions, monitor the repository, and be prepared to fork or replace it if it becomes unmaintained; also test your Mailer DSN and templates because silent email misconfiguration means silent non-alerting.