Laravel Pulse is a new free and open source performance monitoring and insights tool for Laravel applications. Announced at Laracon AU 2023. jess archer From the Laravel core team.
What is Laravel Pulse?
Laravel Pulse is Aggregated view of performance data For Laravel apps. Track metrics like:
- System statistics (CPU, memory, storage usage)
- Application usage (requests, slow routes, jobs, etc.)
- Queue throughput
- slow job
- slow queries
- exception
- Cache hit/miss
- Send request time
Pulse is designed specifically for Laravel and is aware of all core components such as queues, events, email, notifications, and caching.
Collect the minimum amount of data necessary to display useful insights. Your data is stored locally, so you maintain complete control.
Laravel Pulse self-hosted Works anywhere Laravel runs, including VPS, Laravel Forge, and Vapor. It has a responsive UI with light and dark modes.
And above all, it is completely free and open source!I appreciate it very much Taylor Otwell To make this possible.
Comparing Pulse and Telescope
You may be wondering how Pulse compares to Laravel’s other debugging tool, Laravel Telescope.
Telescopes are ideal for these purposes: regional development This is because it records extensive request data such as all queries and events. However, this high level of detail makes it less ideal for production.
Laravel Pulse provides High-level aggregate data This eliminates waste and makes it ready for production immediately. It does not replace the error tracker, but it extends it nicely.
interactive live demo
At Laracon AU, Jess Archer gave an interactive live demo of Laravel Pulse using the audience’s mobile phones.
Viewers acted as flight managers on the fictitious Acme Airlines app. They can perform actions such as:
- sell tickets
- raise the price
- flight delay
- flight cancellation
Meanwhile, Jess showed how Laravel Pulse tracks these actions in real time on a dashboard.
Here we summarize some highlights.
How to use the application
of How to use the application The card shows:
- Users with top requests
- Top users by slow endpoints
- Top users queuing jobs
This gives you insight into who is using your app and the performance issues they are facing.
slow route
of slow route The card displays application routes that exceed the configured threshold (default 1 second).
It shows route names and action methods so you can pinpoint slow code.
late work
of late work The card is similar and displays queued jobs that exceed the threshold. Displays the name and location of the job class.
The count increments each time a failed job is retried, allowing you to identify problematic jobs.
slow queries
of slow queries Cards reveal queries that exceed a threshold. It only shows SQL without bindings, so it looks like this:
- Obfuscate PII
- Aggregate identical queries into one result
- Shows the location of the file where the query occurred
You can optionally disable location to further aggregate results.
exception
of exception The card tracks exceptions thrown, including location, number, and last occurrence.
You can also sort by most recent exception.
cache
of cache The card tracks cache key usage and cache hits and misses.
It doesn’t make any assumptions about the keys, but you can regroup and roll up the collected data if you want a more generalized view of the data.
Outgoing request
Laravel’s HTTP client usage is tracked as follows: Outgoing request. You can see that the external requests your app makes are slow.
The demo used regular expressions in the configuration file to compress unique URLs into generalized domain names similar to toe cache data.
Customize your dashboard
Pulse blade files can be published and customized. For example, you can:
- Toggle full width mode
- Adjust number of columns
- Set card span and position
- Split cards into individual sections
You can also create your own custom cards to display metrics specific to your business. The demo included a “flight” card showing tickets sold, revenue, delays, and best sellers.
Performance considerations
Pulse collects minimal data and can handle heavy production workloads. Larave Forge runs 2 million requests/day No sampling required.
By default, Pulse saves request data to the database after sending the response. Some options for scaling:
- Use a dedicated Pulse database
- Redis is queued and stored outside the request cycle
- Run Pulse on another server
- Enable high traffic sampling
- Creating a custom data driver
When can I use Pulse?
Laravel Pulse is expected to be released in the next week or so. it is, composer require
Away. Please look forward to the official release!
conclusion
Laravel Pulse provides easy insight into the performance and usage of your Laravel apps. Its customizability and minimal overhead make it a great open source addition to your Laravel project.
Thank you to the entire Laravel team for providing another great free tool to the community!