php artisan, programmatically via Artisan::call(), and scheduled commands.
Commands are one of the primary execution contexts in Nightwatch, alongside requests and scheduled tasks. Each command execution becomes the starting point of a new trace, where all subsequent events such as database queries, queued jobs, and exceptions are captured and linked together to provide a complete picture of your application’s behavior.
Command List
View all commands for an application from the Commands panel. Each command is displayed with its name, success and failure statistics and average and p95 execution times.Command Details
Click any command in the list to open its details page, where you can view its performance over time. The page also shows every individual execution of that command, and selecting one opens the full trace so you can see the command and all of its associated child events.Sampling
Global Sampling
You can configure global sampling for Artisan commands using theNIGHTWATCH_COMMAND_SAMPLE_RATE environment variable. When a command is sampled in, Nightwatch captures the full execution context, including related database queries, queued jobs, and exceptions.
Sampling Specific Commands
You can exclude specific commands from sampling by listening for theCommandStarting event:
AppServiceProvider.php
Filtering
There are no specific filtering methods for commands. To conditionally exclude commands from collection, you can use the sampling mechanisms described above.Redaction
You can manually redact command arguments that may contain sensitive information using theredactCommands callback: