Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Health Laravel Package

spatie/laravel-health

Monitor your Laravel app’s health by registering checks (disk space, etc.) with warning/fail thresholds. Get notified via mail or Slack when checks degrade, and extend with custom checks for proactive alerting.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Proactive Monitoring & Reliability: Enables building a self-healing infrastructure by integrating health checks into Laravel applications, reducing downtime and improving SLA compliance. Aligns with roadmap items like "Zero-Downtime Operations" or "Automated Incident Response".
  • Build vs. Buy: Buy—avoids reinventing health-check infrastructure (e.g., custom cron jobs, manual alerts). Justifies investment by reducing DevOps overhead and improving observability.
  • Use Cases:
    • Production-grade monitoring for SaaS platforms (e.g., alerting on disk space, queue backlogs, or external API failures).
    • Compliance/Regulatory Requirements: Automatically log and notify on critical failures (e.g., payment processor downtime for fintech apps).
    • Multi-tenant Apps: Isolate health checks per tenant (e.g., database connections, storage quotas) to prevent cascading failures.
    • Hybrid Cloud/Edge Deployments: Centralize health checks across distributed Laravel instances (e.g., using Oh Dear for cross-region monitoring).
  • Data-Driven Decisions: Enables historical trend analysis (via stored results) to optimize resource allocation (e.g., "We hit 90% disk usage at 3 PM daily—schedule backups then").
  • Cost Efficiency: Reduces reliance on third-party monitoring tools (e.g., New Relic, Datadog) for basic checks, lowering operational costs.

When to Consider This Package

  • Adopt if:
    • Your Laravel app has critical dependencies (e.g., databases, APIs, queues) requiring real-time monitoring.
    • You need multi-channel alerts (Slack + email + Oh Dear) without integrating separate tools.
    • Your team lacks dedicated DevOps resources to maintain custom health-check scripts.
    • You’re deploying to shared hosting where cron jobs or external monitoring is restricted.
    • You want to audit historical failures (e.g., for postmortems or capacity planning).
  • Look Elsewhere if:
    • You’re using non-Laravel stacks (e.g., Django, Node.js)—consider platform-specific tools (e.g., django-health-check, express-health).
    • You need advanced metrics (e.g., latency percentiles, custom dashboards)—pair with Prometheus/Grafana or dedicated APM tools.
    • Your checks require low-level system metrics (e.g., CPU, memory)—use sysstat or cloud-native tools (AWS CloudWatch).
    • You’re building a serverless app—consider event-driven architectures (e.g., AWS Lambda + EventBridge alerts).
    • You need SRE-level alert fatigue management (e.g., dynamic thresholds, multi-sig approvals)—combine with tools like PagerDuty.

How to Pitch It (Stakeholders)

For Executives (C-Suite/Finance)

*"This package turns ‘firefighting’ into ‘prevention.’ By automating health checks for our Laravel apps—like disk space, API uptime, or queue backlogs—we’ll:

  • Reduce downtime by catching issues before users notice (e.g., Slack alerts for critical failures).
  • Cut DevOps costs by replacing manual checks with a $0 open-source solution (vs. $100+/month for third-party tools).
  • Improve compliance with automated logging of failures (e.g., for PCI/DSS or GDPR audits). Example: If our payment processor fails, we’ll auto-notify the team and snooze alerts during maintenance windows—saving 10+ hours/year in incident response. ROI: ~$20K/year in saved labor and avoided revenue loss from downtime."*

For Engineering Leaders (CTO/Engineering Managers)

*"This is a drop-in solution for Laravel’s observability gap. Key wins:

  • Unified Monitoring: Replace ad-hoc cron jobs/alerts with a single, configurable system (e.g., UsedDiskSpaceCheck, DatabaseConnectionCheck).
  • Extensible: Add custom checks in minutes (e.g., ThirdPartyAPICheck for Stripe/PayPal).
  • Oh Dear Integration: Offload notifications to a third party to avoid ‘dead app’ scenarios (e.g., if your SMTP fails, Oh Dear still alerts you).
  • Zero Lock-in: MIT-licensed, no vendor dependency. Migration Path: Start with InMemoryHealthResultStore, then add DB storage if needed. Trade-offs: Minimal performance overhead (~50ms per check); requires scheduling the RunHealthChecksCommand (every minute)."*

For Developers (Backend/DevOps)

*"This package solves the ‘how do I monitor X?’ problem without reinventing the wheel. Here’s how to use it:

  1. Install: composer require spatie/laravel-health.
  2. Configure: Add checks in a service provider (e.g., UsedDiskSpaceCheck::new()->failAt(90%)).
  3. Alert: Slack/email notifications auto-configured (or use Oh Dear for redundancy).
  4. Scale: Supports multiple result stores (DB, cache, JSON files) and custom checks (e.g., CheckIfFeatureFlagIsEnabled). Pro Tip: Use the ?fresh endpoint for external monitoring (e.g., Terraform Cloud or Datadog checks). Alternatives: If you need more, pair with spatie/laravel-monitoring for logs or laravel-debugbar for debugging."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport