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, queues, cache, etc.). Set warning/fail thresholds and get notified via mail or Slack when something goes wrong, so you can catch issues early and keep services running smoothly.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Proactive Monitoring & Reliability: Enables automated health checks for Laravel applications, reducing MTTR (Mean Time to Recovery) by alerting teams to infrastructure, service, or dependency failures before they impact users.
  • Scalability & Observability: Supports build vs. buy decisions by providing a lightweight, customizable alternative to building in-house monitoring systems. Ideal for SaaS platforms, APIs, or high-traffic applications where uptime is critical.
  • DevOps & SRE Alignment: Integrates with CI/CD pipelines (e.g., pre-deployment checks) and aligns with Site Reliability Engineering (SRE) practices by defining Service Level Objectives (SLOs) for infrastructure (e.g., disk space, queue backlogs, database connectivity).
  • Multi-Environment Support: Use cases include:
    • Staging/Production Parity: Ensure consistency in health checks across environments.
    • Feature Flags & Canary Releases: Validate infrastructure health before rolling out updates.
    • Disaster Recovery: Monitor backups, external APIs (e.g., payment gateways), and third-party services (e.g., Meilisearch, Redis).
  • Cost Optimization: Reduces operational overhead by automating alerts for resource constraints (e.g., disk space, memory) before they trigger costly incidents.
  • Compliance & Auditing: Logs health check results for post-mortems and compliance reporting (e.g., SOC 2, ISO 27001).

When to Consider This Package

Adopt This Package If:

  • Your Laravel application relies on external dependencies (databases, APIs, queues, storage) that require proactive monitoring.
  • You lack a centralized observability tool (e.g., Datadog, New Relic) but need lightweight, code-level health checks.
  • Your team follows infrastructure-as-code principles and wants to define health checks in the same repository as the application.
  • You need customizable thresholds (e.g., warn at 70% disk usage, fail at 90%) without vendor lock-in.
  • Your application uses Laravel 10+ and requires support for modern features like Horizon queues, immutable dates, or Symfony 8.
  • You want low-code integration with existing notification systems (Slack, email) via Laravel’s built-in channels.

Look Elsewhere If:

  • You need real-time metrics (e.g., CPU/memory usage graphs) → Use Prometheus + Grafana or a dedicated APM tool.
  • Your stack is non-Laravel (e.g., Node.js, Python) → Consider framework-specific alternatives (e.g., healthchecks.io).
  • You require distributed tracing (e.g., microservices) → Use OpenTelemetry or Jaeger.
  • Your team prefers managed services (e.g., AWS Health API, Azure Monitor) over self-hosted solutions.
  • You need historical trend analysis → Pair with a time-series database (e.g., InfluxDB) or export data to a BI tool.

How to Pitch It (Stakeholders)

For Executives (Business Leaders):

"This package lets us automate infrastructure health monitoring within our Laravel apps, reducing downtime and operational fire drills. For example, it can alert us if disk space drops below 20% or if payment gateways become unresponsive—before users notice. It’s a low-cost, high-impact way to improve reliability, especially for our SaaS customers who depend on 99.9% uptime. Implementation is minimal (a few lines of code), and it integrates with our existing Slack/email alerts. Think of it as ‘insurance for our infrastructure.’"

ROI:

  • Reduced MTTR: Catch failures before they escalate.
  • Cost Savings: Avoid last-minute cloud resource scaling or emergency fixes.
  • Customer Trust: Proactive reliability signals to stakeholders.

For Engineering (DevOps/SRE/Dev Teams):

"spatie/laravel-health gives us a batteries-included way to define and monitor critical infrastructure checks*—without reinventing the wheel. Here’s why it’s a no-brainer:

  • Custom Checks: Monitor anything from database connections to third-party APIs (e.g., Stripe, Algolia) with configurable thresholds.
  • Seamless Integration: Works with Laravel’s notification system (Slack, email, etc.) and supports environment-specific configs (e.g., stricter checks in production).
  • Extensible: Add custom checks in minutes (e.g., App\Checks\CustomServiceCheck). The package even includes Horizon queue monitoring and backup validation.
  • Lightweight: No external dependencies beyond Laravel’s core. Runs as a scheduled command (e.g., via Laravel’s scheduler) or HTTP endpoint for external monitoring tools.
  • Future-Proof: Actively maintained (recent Laravel 13 support, Symfony 8 compatibility), with a growing ecosystem of community checks.

Example Use Case:

Health::checks([
    UsedDiskSpaceCheck::new()->failWhenUsedSpaceIsAbovePercentage(90),
    DatabaseConnectionCheck::new()->failIfConnectionCannotBeEstablished(),
    QueueCheck::new()->failAfterMinutes(5), // Alert if queues are stuck >5 mins
]);

Proposal: Let’s pilot this in staging first, then roll it out to production with checks for our critical dependencies. We can start with 3–5 key metrics and expand as needed."*

Tech Benefits:

  • Reduces alert fatigue by focusing on actionable failures (e.g., "Queue backlog exceeded SLA").
  • Works alongside existing tools (e.g., export results to Datadog or store in a DB for analysis).
  • Developer-friendly: Checks are defined in PHP, so they live alongside the code they monitor.
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.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony