Download the PHP package illuma-law/healthcheck-typesense without Composer
On this page you can find all versions of the php package illuma-law/healthcheck-typesense. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download illuma-law/healthcheck-typesense
More information about illuma-law/healthcheck-typesense
Files in illuma-law/healthcheck-typesense
Package healthcheck-typesense
Short Description A Typesense health check for Spatie's Laravel Health package.
License MIT
Homepage https://github.com/illuma-law/healthcheck-typesense
Informations about the package healthcheck-typesense
Healthcheck Typesense for Laravel
A Typesense health check for Spatie's Laravel Health package.
This package provides a direct and reliable way to ensure your Typesense search cluster is reachable and responding quickly. It checks the built-in /health API of Typesense and alerts you if the service goes down or experiences severe latency.
Features
- Reachability Check: Verifies that your Laravel application can successfully connect to your Typesense cluster.
- Latency Monitoring: Measures the exact response time of the Typesense cluster. If the response time exceeds a specified timeout threshold, the check will degrade to a Warning state.
- Flexible Configuration: Connect using config values, passing arrays fluently, or even injecting an already instantiated
Typesense\Client.
Installation
Require this package with composer:
Configuration
You can publish the config file to define the connection settings across your application:
The resulting config/healthcheck-typesense.php will look like this:
Usage & Integration
Add the check inside your AppServiceProvider or your dedicated HealthServiceProvider.
Basic Registration
If you have configured the connection in the published configuration file, you can register the check cleanly without passing any arguments:
Fluent Configuration
You can override default settings dynamically. This is useful if you are fetching connection settings from a different configuration file (like Scout) or testing.
Injecting the Client
If you already bind the Typesense\Client in your Laravel container, you can pass it directly to avoid re-initializing it:
Expected Result States
The check communicates with the Spatie Health dashboard using these states:
- OK: Typesense responded successfully within the defined timeout threshold. The short summary shows the response time (e.g.,
12ms). - Warning: Typesense responded successfully, but the response time was higher than the configured
timeout_seconds. - Failed: Typesense was unreachable, the connection timed out entirely, or an authentication error occurred.
Testing
Run the test suite:
License
The MIT License (MIT). Please see License File for more information.
All versions of healthcheck-typesense with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
spatie/laravel-health Version ^1.39
typesense/typesense-php Version ^6.0