aeatech/cli-snapshot-profiler-newrelic-bundle
Symfony bundle for profiling CLI commands with New Relic snapshot/transactions. Supports production use, configurable via env vars, and can profile all commands or only selected command names. Requires PHP 8.2+ and the New Relic extension.
ext-newrelic) for production-grade profiling, which aligns with observability-driven architectures. Ideal for teams already using New Relic for APM.symfony/console) allows for partial adoption (e.g., profiling custom Artisan commands or CLI tools built with Symfony Console).ConsoleEvents), which Laravel’s Artisan commands can also trigger.ext-newrelic (v12.1+), which may necessitate:
ConsoleEvents. Requires explicit setup (e.g., a base command class or event subscriber).--profile or sampling.)symfony/console-powered CLI app).ConsoleEvents to Artisan commands. Example:
// app/Listeners/ProfileArtisanCommand.php
public function handle(CommandEvent $event): void {
if (config('aea_tech_cli_snapshot_profiler_newrelic.is_profiling_enabled')) {
// Trigger New Relic profiling via bundle's service
}
}
ext-newrelic compatibility (PHP version, agent version).is_profiling_enabled: true in config/packages/aea_tech_cli_snapshot_profiler_newrelic.yaml.app_name and license via environment variables.Artisan::class or use a command resolver to inject profiling logic.ProfilableCommand class for all commands needing profiling.hrtime() or Blackfire.| Component | Compatibility Notes |
|---|---|
| PHP | Requires PHP 8.2+. Laravel 10+ uses PHP 8.1+ (upgrade may be needed). |
| New Relic Agent | Tested on v12.1+. Ensure agent is compatible with Laravel’s PHP version. |
| Symfony | Bundle targets Symfony 6+. Laravel 10 uses Symfony 6.2 (likely compatible). |
| Laravel Artisan | No native support; requires custom integration (event listeners or command wrappers). |
| Environment | Works in both dev and prod (configurable). |
ext-newrelic and configure New Relic license.AEA_TECH_CLI_SNAPSHOT_PROFILER_NEWRELIC_*).bundles.php.aeatech/cli-snapshot-profiler-newrelic-bundle (no major maintainer yet; risk of abandonment).APP_NEWRELIC_LICENSE) to avoid hardcoding.aea_tech_cli_snapshot_profiler_newrelic:
logging:
enabled: true
channel: 'single'
>5s).aea_tech_cli_snapshot_profiler_newrelic:
is_profiling_enabled: '%kernel.debug% && env(IS_CLI_PROFILING_ENABLED)' # Disable in CI
prod vs. staging profiling thresholds).How can I help you explore Laravel packages today?