{{ __('Health Monitoring Setup Guide') }}

Introduction

The health monitoring system provides real-time insights into your application's performance, including database status, cache operations, queue health, storage usage, and email tracking. This guide will help you set up and maintain the monitoring system.

System Requirements

  • PHP 8.1 or higher
  • Laravel 10.x
  • MySQL/MariaDB database
  • Redis (recommended for cache and queue)
  • Cron job access on your server

Installation Steps

1. Install Dependencies

composer require laravel/pulse

2. Publish Configuration

php artisan vendor:publish --tag=pulse-config

3. Run Migrations

php artisan migrate

Cron Job Setup

To ensure continuous monitoring and background job processing, you need to set up a cron job on your server.

Add to Server Crontab

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Replace /path-to-your-project with your actual project path

Queue Worker Setup

The queue worker is configured to run via the Laravel scheduler. This handles background tasks like:

  • Email sending and tracking
  • Background processing tasks
  • Webhook processing
  • System notifications

Current Configuration

// In app/Console/Kernel.php
$schedule->command('queue:work --stop-when-empty')
    ->everyMinute()
    ->withoutOverlapping();

This configuration ensures that:

  • Queue worker runs every minute
  • Stops when no jobs are available
  • Prevents multiple workers from running simultaneously

Monitoring Features

Basic Health Checks

  • Database connection and response time
  • Cache system status
  • Queue health and job status
  • Storage usage and availability
  • Email tracking statistics

Advanced Analytics

  • Request performance metrics
  • Cache hit/miss rates
  • Queue processing times
  • Exception tracking
  • Job execution statistics

Maintenance

Regular Tasks

  • Monitor the health dashboard daily
  • Check for any failed jobs or exceptions
  • Review storage usage and clean up if needed
  • Verify email tracking statistics

Troubleshooting

  • If metrics stop updating, check cron job status
  • Verify database connection if health checks fail
  • Check server logs for any errors
  • Ensure Redis is running if using it for cache/queue

Support

If you encounter any issues or need assistance with the health monitoring system, please contact your system administrator or refer to the Laravel Pulse documentation.