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

title: As JSON weight: 2

When using the Spatie\Health\ResultStores\JsonFileHealthResultStore result store the latest check results will be written to a JSON file.

In the health config file, the store can be configured in the health_stores key like this:

return [
    'result_stores' => [
        JsonFileHealthResultStore::class => [
            'disk' => 's3',
            'file_name' => 'health.json',
        ],
    ],

The disk key can be set to any of the disks you configured in config/filesystems.php. Using an external disk, like s3, has the benefit that, should your application go down, you can still see the latest results via an S3 url. In case your app is fully down, external services monitoring your health file, should notice that the finishedAt key in the contents will not be updated anymore.

You can parse this file get detailed information of how the checks have run. This can be used as the basis for a dashboard, or you could let an external service monitor the contents of this file. The JSON contains two top level properties:

  • finishedAt: the datetime when all checks have finished running
  • checkResults: the results of all checks

Here's an example of how the content could look like:

{
    "finishedAt": "2021-01-01 12:25:12",
    "checkResults": [
        {
            "name": "UsedDiskSpace",
            "message": "The disk getting full ({$usedDiskSpacePercentage}% used)",
            "status": "warning",
            "meta": {
                "disk_space_used_percentage": 75
            }
        }
    ]
}
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