Introduction | laravel-health-go | Spatie       

 SPATIE  

laravel-health-go
=================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-health-go](https://spatie.be/docs/laravel-health-go/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-health-go/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/laravel-health-go/v1/introduction)
- [ Requirements ](https://spatie.be/docs/laravel-health-go/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-health-go/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-health-go/v1/questions-issues)
- [ About us ](https://spatie.be/docs/laravel-health-go/v1/about-us)
- [ Testing ](https://spatie.be/docs/laravel-health-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/laravel-health-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/laravel-health-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/laravel-health-go/v1/support-us)

Usage
-----

- [ Registering your first check ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/registering-your-first-check)
- [ Creating custom checks ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/creating-custom-checks)
- [ Manually running checks ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/manually-running-checks)
- [ Conditionally running or modifying checks ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/conditionally-running-or-modifying-checks)
- [ Endpoints ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/endpoints)
- [ Pausing and resuming checks ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/pausing-and-resuming-checks)
- [ Registering the same check multiple times ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/registering-the-same-check-multiple-times)
- [ Testing ](https://spatie.be/docs/laravel-health-go/v1/basic-usage/testing)

Storing results
---------------

- [ General ](https://spatie.be/docs/laravel-health-go/v1/storing-results/general)
- [ In the database ](https://spatie.be/docs/laravel-health-go/v1/storing-results/in-the-database)
- [ In cache ](https://spatie.be/docs/laravel-health-go/v1/storing-results/in-cache)
- [ In a JSON file ](https://spatie.be/docs/laravel-health-go/v1/storing-results/in-a-json-file)
- [ Not storing results ](https://spatie.be/docs/laravel-health-go/v1/storing-results/not-storing-results)

Configuring notifications
-------------------------

- [ General ](https://spatie.be/docs/laravel-health-go/v1/configuring-notifications/general)
- [ Via mail ](https://spatie.be/docs/laravel-health-go/v1/configuring-notifications/via-mail)
- [ Via Slack ](https://spatie.be/docs/laravel-health-go/v1/configuring-notifications/via-slack)
- [ Via Microsoft Teams ](https://spatie.be/docs/laravel-health-go/v1/configuring-notifications/via-teams)
- [ Via Oh Dear ](https://spatie.be/docs/laravel-health-go/v1/configuring-notifications/via-oh-dear)

Available checks
----------------

- [ Overview ](https://spatie.be/docs/laravel-health-go/v1/available-checks/overview)
- [ Cache ](https://spatie.be/docs/laravel-health-go/v1/available-checks/cache)
- [ Debug mode ](https://spatie.be/docs/laravel-health-go/v1/available-checks/debug-mode)
- [ Environment ](https://spatie.be/docs/laravel-health-go/v1/available-checks/environment)
- [ Database connection count ](https://spatie.be/docs/laravel-health-go/v1/available-checks/db-connection-count)
- [ Database connection ](https://spatie.be/docs/laravel-health-go/v1/available-checks/db-connection)
- [ Database size ](https://spatie.be/docs/laravel-health-go/v1/available-checks/db-size-check)
- [ Database table size ](https://spatie.be/docs/laravel-health-go/v1/available-checks/db-table-size-check)
- [ CPU load ](https://spatie.be/docs/laravel-health-go/v1/available-checks/cpu-load)
- [ Used disk space ](https://spatie.be/docs/laravel-health-go/v1/available-checks/used-disk-space)
- [ Ping ](https://spatie.be/docs/laravel-health-go/v1/available-checks/ping)
- [ Redis memory usage ](https://spatie.be/docs/laravel-health-go/v1/available-checks/redis-memory-usage)
- [ Redis ](https://spatie.be/docs/laravel-health-go/v1/available-checks/redis)
- [ Flare error count ](https://spatie.be/docs/laravel-health-go/v1/available-checks/flare-error-count)
- [ Meilisearch ](https://spatie.be/docs/laravel-health-go/v1/available-checks/meilisearch)
- [ Reverb ](https://spatie.be/docs/laravel-health-go/v1/available-checks/reverb)
- [ Cached config, routes, and events ](https://spatie.be/docs/laravel-health-go/v1/available-checks/cached-config-routes-and-events)
- [ Horizon ](https://spatie.be/docs/laravel-health-go/v1/available-checks/horizon)
- [ Security advisories ](https://spatie.be/docs/laravel-health-go/v1/available-checks/security-advisories)
- [ Queue ](https://spatie.be/docs/laravel-health-go/v1/available-checks/queue)
- [ Schedule ](https://spatie.be/docs/laravel-health-go/v1/available-checks/schedule)
- [ Backups ](https://spatie.be/docs/laravel-health-go/v1/available-checks/backups)

Viewing results
---------------

- [ General ](https://spatie.be/docs/laravel-health-go/v1/viewing-results/general)
- [ On the CLI ](https://spatie.be/docs/laravel-health-go/v1/viewing-results/on-the-cli)
- [ On a webpage ](https://spatie.be/docs/laravel-health-go/v1/viewing-results/on-a-webpage)
- [ As JSON ](https://spatie.be/docs/laravel-health-go/v1/viewing-results/as-json)

Security
--------

- [ Using secret token ](https://spatie.be/docs/laravel-health-go/v1/security/using-secret-token)

  Laravel-health-go 
===================

 Monitor the health of a Laravel Go application 

### Useful links

- [Repository](https://github.com/spatie/laravel-health-go)
- [Discussions](https://github.com/spatie/laravel-health-go/discussions)

Introduction
------------

###  On this page 

1. [ Differences from PHP ](#content-differences-from-php)

Using this package you can monitor the health of your application by registering one of [the available checks](available-checks/overview).

Here's an example where we'll monitor used disk space.

```
health.New(func(cfg *health.Config) {
    cfg.Checks = []health.Registration{
        health.Register("UsedDiskSpace", health.UsedDiskSpaceCheck{
            WarnAbove: 70,
            FailAbove: 90,
        }),
    }
})
```

When used disk space is over 70%, the result is a warning. Above 90%, it fails. Configure [mail, Slack or Teams](configuring-notifications/general) to receive notifications. You can also let Oh Dear monitor the results.

Need a custom check? You [can create your own](basic-usage/creating-custom-checks). The package can also display [an overview](viewing-results/on-a-webpage) of all health check results.

Start with [installation and setup](installation-setup).

Differences from PHP
--------------------------------------------------------------------------------------------------------------------

Go checks implement an interface rather than extending a class. Configuration uses typed callbacks instead of published PHP files. `ModelStore[T]`, `JobFactory`, `Notifier` and `PageRenderer` replace the corresponding model, job, notification and view extension points.

The default result store is Laravel's configured cache, not a database. Database history stores a complete run atomically in one row and prunes old rows on save. This schema is not interchangeable with PHP Health's per-check rows. Cache results, heartbeat markers and grace markers have a one-year lifetime. Use a shared cache for multiple processes.

Horizon requires an application adapter. PHP's cached config, routes and events have no direct equivalent in a compiled Go app, so the optimization check accepts a deployment verifier. Third-party PHP checks, including Composer security advisories, cannot run in Go.

The dashboard follows the system light or dark preference. Replace its renderer for an application theme. Probe errors become crashed results and are reported through Laravel. Panics are not recovered. Cancellation stops the run without storing partial results. Store, event and delivery errors propagate to the caller.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
