Symfony Commands Monitoring
Blackfire PHP SDK now provides a seamless integration to monitor you CLI commands.
Blackfire Monitoring provides the ability to trace web requests and CLI commands. This is particularly useful when your application is using consumers, e.g. using Symfony Messenger or Laravel Horizon, but also in the case of commands you may run as cron jobs.
Introducing Symfony CLI Commands Integration
The Blackfire PHP SDK v1.28.0 provides a new seamless integration with Symfony CLI Commands. With this integration, you may now monitor cron jobs commands without even thinking about it!
All you need to do is to make your command classes implement the Blackfire\Bridge\Symfony\MonitorableCommandInterface
interface. This way, these commands would be auto-traced, and a transaction name would be generated after the command name:
namespace App\Command; use Blackfire\Bridge\Symfony\MonitorableCommandInterface; use Symfony\Component\Console\Command\Command; class UpdateSightingScoresCommand extends Command implements MonitorableCommandInterface { protected static $defaultName = 'app:update-sighting-scores'; }
In the example above, the transaction would be named app:update-sighting-scores
.
Start a Blackfire Monitoring subscription today!
Happy cron job Monitoring!