Mastering Application Health: Monitoring and Alarms in Laravel Vapor
Overview
Monitoring is the heartbeat of any production application. In a serverless environment like , where resources scale dynamically, visibility into performance is critical. This guide explores how to track environment health, database utilization, and queue performance while setting up proactive alerts to catch issues before they impact users.
Prerequisites
To follow this guide, you should have a basic understanding of the framework and cloud hosting concepts. An active account linked to a project is required to access the metrics dashboard and notification settings.
Key Libraries & Tools
- : A serverless deployment platform for powered by .
- : A dedicated dashboard package for monitoring queue jobs and failed processes within your application.
- : The underlying compute service that powers Vapor environments.
Environment Metrics and Alarms
Every environment in provides a Metrics tab that aggregates data from . You can monitor HTTP request volume, average request duration, and the estimated cost per function. To prevent surprises, you must configure Notification Methods first. Once a method (like email) is active, you can create alarms. For example, setting an alarm for "more than 10 requests per minute" ensures you are alerted during traffic spikes or potential DDoS attempts.
Monitoring Fixed-Size Resources
Unlike queues, resources like databases and clusters often have fixed sizes. Monitoring their CPU Utilization is vital. If a database or cache consistently hits near 100% CPU usage, the application will experience significant latency. In these cases, use the Scale button within the Vapor UI to increase server specs or add nodes to your cache cluster.
Syntax Notes and Queue Management
For detailed queue monitoring, you need the package. Once installed via Composer, it provides a dashboard to track pending and failing jobs. While scales queues automatically, you should focus on the Failed Jobs tab. This interface allows you to inspect the stack trace of a failure and choose to retry or forget the job directly from the browser.
Tips & Gotchas
- Timeframes Matters: Always check if you are viewing the "Last 24 Hours" or a shorter window when debugging a recent incident.
- Alarm Thresholds: Don't set alarms too low for environments with high natural variance, or you'll suffer from "alert fatigue."
- Cost Awareness: Monitoring estimated cost metrics helps you identify inefficient code that may be causing unnecessary execution time.
- 31%· products
- 19%· products
- 13%· companies
- 13%· products
- 13%· products
- Other topics
- 13%

Learn Laravel Vapor #19: Monitoring
WatchLaravel // 4:55
The official YouTube channel of Laravel, the clean stack for Artisans and agents. We will update you on what's new in the world of Laravel, from the framework to our products Cloud, Forge, and Nightwatch.