Conversation
Carbon 3 diffInMinutes() returns floats, so a 1-minute heartbeat cycle always exceeds the default 1-minute threshold by milliseconds. Also use filled() for Oh Dear secret check and cast config env value.
# Conflicts: # app/Providers/HealthServiceProvider.php # config/app.php # config/health.php
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive health monitoring system using Spatie's Laravel Health package. The implementation is opt-in via configuration and adds monitoring for critical application components including database, Redis, queues, disk space, CPU load, and security advisories.
Changes:
- Added health check functionality using Spatie Laravel Health with configurable opt-in via
HEALTH_CHECKS_ENABLEDenvironment variable - Configured import-related jobs to use dedicated 'imports' queue for better monitoring and separation of concerns
- Removed empty
routes/console.phpfile as scheduling is now handled inbootstrap/app.php
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/Providers/HealthServiceProvider.php | New service provider that registers comprehensive health checks when enabled via config |
| bootstrap/providers.php | Registered HealthServiceProvider in alphabetically sorted provider list |
| bootstrap/app.php | Added health check scheduling commands and removed reference to deleted console routes file |
| config/app.php | Added health_checks_enabled configuration option with environment variable support |
| config/health.php | Configuration for Spatie Health package including result stores, notifications, and Oh Dear integration |
| .env.example | Added documentation for health check environment variables |
| tests/Feature/HealthChecks/HealthServiceProviderTest.php | Tests verifying health checks are registered only when enabled |
| app-modules/ImportWizard/src/Jobs/ExecuteImportJob.php | Assigned job to 'imports' queue for monitoring |
| app-modules/ImportWizard/src/Jobs/ResolveMatchesJob.php | Assigned job to 'imports' queue for monitoring |
| app-modules/ImportWizard/src/Jobs/ValidateColumnJob.php | Assigned job to 'imports' queue for monitoring |
| routes/console.php | Removed empty console routes file |
| composer.json | Added spatie/laravel-health, spatie/cpu-load-health-check, and spatie/security-advisories-health-check packages |
| composer.lock | Lock file updates for new health check dependencies |
Comments suppressed due to low confidence (1)
app/Providers/HealthServiceProvider.php:41
- The named parameter
errorThresholdGbis inconsistent with the fluent method naming convention used elsewhere in this file. Other health check methods use implicit parameter names (e.g.,warnWhenMoreConnectionsThan(50),failWhenAboveMb(1_000)). For consistency, consider removing the named parameter and just usingfailWhenSizeAboveGb(10.0)to match the pattern used throughout the rest of the health checks configuration.
DatabaseSizeCheck::new()
->failWhenSizeAboveGb(errorThresholdGb: 10.0),
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.