Skip to main content

Laravel Pulse Monitoring Setup

Set up Laravel Pulse for application performance monitoring with custom cards, alerts, slow query detection, and team-wide dashboards.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Set up comprehensive application monitoring using Laravel Pulse for a e-commerce platform with API and admin panel handling 500,000 requests per day. The application runs on 3 web servers behind an ALB on AWS with MySQL 8.0 as the primary database. Use Laravel 11. Implement: 1) Install and configure Pulse: set up the pulse.php config, configure the database storage driver, define the data retention period of 7 days, and set the recording sample rate to 0.1 (10% of requests) for production. Add the Pulse middleware to the web and API route groups. 2) Configure built-in recorders: enable slow query detection with a threshold of 500ms, slow request detection at 1000ms, exception tracking, queue job monitoring, cache hit/miss tracking, and slow outgoing HTTP request detection. Customize which routes and queries to health check routes, Pulse own queries, and Horizon routes ignore. 3) Build 3 custom Pulse cards: create a Revenue Per Minute (tracks order creation rate and total value) card that queries Pulse data using the Recorder pattern — implement the card component (Livewire), the recorder class that captures the metric, and the card view. Additional cards: Active Users (real-time count) and Payment Gateway Latency. 4) Create a team dashboard layout: organize cards into a responsive grid in the Pulse dashboard view, with Performance, Database, Queue Health, Business Metrics sections. Configure role-based access using the Gate definition so only admin and devops can view the dashboard. 5) Set up alerting: implement 5 alert rules that trigger when: p95 response time > 2s, error rate > 1%, queue backlog > 1000 jobs, cache miss rate > 30%. Alerts should notify via Slack (#monitoring) and email to on-call using Laravel notifications. Include a cooldown period of 15 minutes to prevent alert fatigue. 6) Optimize Pulse for production: configure the ingest method (buffered with async write) to minimize impact on request latency, set up a separate database connection for Pulse data if yes, a dedicated pulse MySQL database, implement data aggregation that rolls up detailed records into hourly/daily summaries, and schedule the pulse:purge command to run daily at 3am UTC. 7) Create a deployment health check: build a Pulse-based post-deployment verification that compares error rate, p95 response time, and cache hit rate between the last 30 minutes before and after deployment, flagging regressions above 20% degradation.

What this prompt does

This prompt makes the AI set up Laravel Pulse monitoring for an app handling [traffic_volume] on [infrastructure] with [database_type], on Laravel [laravel_version]. It configures the [storage_method] driver, sets [retention_period] and [sample_rate], enables built-in recorders with thresholds like [slow_query_threshold] and [slow_request_threshold], and builds [custom_card_count] custom cards. Declaring traffic volume up front is what pushes the AI toward sampling and a separate database rather than a setup that buckles under load.

The structure works because production monitoring lives in its specifics. The [primary_card] and [additional_cards] capture business metrics next to slow queries; [dashboard_sections] and [authorized_roles] organize and gate the dashboard; [alert_count] rules fire on [alert_conditions] through [notification_channels] with an [alert_cooldown] to prevent fatigue. The production-optimization step uses [ingest_method], an optional [separate_db], aggregation, and a [purge_schedule], plus a post-deploy health check comparing metrics over [comparison_window]. Each custom card is built as a trio — a Livewire component, a recorder class that captures the metric, and a view — so business signals and infrastructure data share one dashboard. The [infrastructure] and [database_type] you declare shape the ignore patterns and recorder thresholds, and the aggregation step rolls detailed records into hourly and daily summaries so the storage table stays manageable at sustained traffic.

When to use it

  • Your app is in production and you want to see what is actually slow
  • You need slow-query and slow-request detection without a heavy external APM
  • You want business metrics like revenue-per-minute beside infrastructure cards
  • You need alerting on response time, error rate, or queue backlog with cooldowns
  • You run real traffic and must sample and isolate monitoring data to limit overhead
  • You want a post-deployment health check that flags regressions automatically

Example output

The AI returns Pulse configuration with [storage_method], [retention_period], and [sample_rate], enabled recorders with your thresholds and ignore patterns, custom card triads (Livewire component, recorder class, view) including [primary_card], a role-gated dashboard organized into [dashboard_sections], [alert_count] alert rules wired to [notification_channels], a production setup with buffered ingest and an optional dedicated Pulse database, and a deployment health check comparing p95, error rate, and cache hit rate before and after release.

Pro tips

  • Set [sample_rate] below 1.0 at high [traffic_volume] — recording every request is what makes naive Pulse setups expensive
  • Use [separate_db] when traffic is real so Pulse writes do not contend with application queries
  • Tune [slow_query_threshold] to your baseline; too low and the dashboard drowns in noise
  • Add an [alert_cooldown] from the start — alert fatigue kills the value of monitoring fast
  • Put real business metrics in [primary_card] so the dashboard is something you watch after every deploy
  • Schedule pulse:purge via [purge_schedule] so retention actually holds and the table does not grow unbounded

Frequently Asked Questions

Will Pulse slow down my application at high traffic?
The prompt mitigates that with a `[sample_rate]` below 1.0, a buffered async `[ingest_method]`, and an optional dedicated `[separate_db]` so monitoring writes do not contend with app queries. These are exactly the levers that matter once you are at real `[traffic_volume]`.
Can it track custom business metrics, not just performance?
Yes. It builds `[custom_card_count]` custom cards, each as a Livewire component, recorder class, and view. The default primary card tracks revenue-per-minute, so business signals sit next to slow queries on one dashboard.
How does the alerting avoid spamming the team?
Each of the `[alert_count]` rules carries an `[alert_cooldown]` so repeated breaches do not fire endlessly. Alerts route through `[notification_channels]` like Slack and email, and you define the trigger conditions in `[alert_conditions]`.
Does it help catch regressions after a deploy?
It builds a Pulse-based health check that compares error rate, p95 response time, and cache hit rate across a `[comparison_window]` before and after deployment, flagging degradation beyond `[regression_threshold]`. It is a verification aid, not a full release-gating system.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Laravel & PHP Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support