Skip to main content
Events are the fundamental building blocks of observability in Nightwatch. Each event captures a single activity, such as a database query, an API call, an email sent, or an exception thrown. Nightwatch connects these events to reveal the complete journey through your application. When debugging an error, you trace its exact path from origin to failure. When investigating slow performance, you identify precisely which queries, cache operations, or external services are the bottleneck. This depth of visibility provides unparalleled insight into improving your application.

Event types

Nightwatch automatically captures these core event types, each with comprehensive contextual data:
  • Requests: HTTP requests handled by your application
  • Queries: Database queries and transactions
  • Outgoing Requests: HTTP calls to external APIs
  • Jobs: Queued jobs and their execution
  • Scheduled Tasks: Scheduled command executions
  • Commands: Artisan commands run via CLI
  • Cache: Interactions with your application cache
  • Mail: Mail sent from your application
  • Notifications: Notifications sent from your application
  • Exceptions: Errors and exceptions thrown
  • Logs: Application log entries

Execution contexts

Events connect together through an execution context — the origin point that triggered a chain of related activities. When a request enters your application, it becomes the execution context. All subsequent events (queries, cache operations, jobs, API calls, exceptions) are linked as children, creating a complete timeline of what happened. In Laravel applications, there are three types of execution contexts:

How events are captured

Events are captured automatically by the Nightwatch agent once installed in your Laravel application. The agent integrates with Laravel’s internals and transmits event data asynchronously, ensuring minimal performance impact. No code changes or manual instrumentation required.

Managing your event quota

Every event captured contributes toward your organization’s monthly quota based on your subscription plan. Control your event consumption using sampling to determine which execution contexts to capture, and filtering to exclude specific events within those contexts. To identify optimization opportunities, view your usage breakdown by application, environment, and event type in the usage area of the settings dashboard. Use this data to apply targeted sampling and filtering strategies where they’ll have the most impact. If you would like to collect more events than your plan’s quota provides, you can set a an Additional Event limit in your billing settings. This will allow you to continue collecting events beyond your quota until your limit is reached.