Download the PHP package net-os/laravel-vitals without Composer

On this page you can find all versions of the php package net-os/laravel-vitals. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-vitals

Laravel Vitals

Latest Version on Packagist Tests

Health checks for Laravel, both for the whole application and per tenant, with a dashboard in the style of Horizon.

Tenancy is optional. Vitals detects stancl/tenancy on its own, and you can plug in any other tenancy package with a TenancyAdapter.

Installation

The install command publishes config/vitals.php and the migration, and offers to run the migration.

Registering checks

Register checks in a service provider:

Central checks run every 5 minutes and tenant checks every 15 minutes, unless a check sets its own frequency. The available frequencies are everyMinute(), everyFiveMinutes(), everyTenMinutes(), everyFifteenMinutes(), everyThirtyMinutes(), hourly(), hourlyAt(15), daily(), dailyAt('06:00') and cron('…'). Vitals spreads tenants over the interval using a stable offset based on the tenant key, so they do not all run in the same minute.

A check registered with onlyFor() runs only for the tenants that pass the callback. The dashboard shows it as "Not applicable" for every other tenant.

If two checks in the same scope have the same key, Vitals throws an exception. Use ->withKey('…') to tell them apart, and ->withLabel('…') to change the name the dashboard shows.

Writing a check

A check returns ok, warning, failed or skipped. Vitals marks a check as crashed when it throws an exception or runs past its timeout (30 seconds by default, change it with ->timeout(10)). The exception is passed to report(). A tenant check runs inside the tenant context, so the default database connection is the tenant's database.

Running

Vitals adds vitals:dispatch (every minute, on one server) and vitals:prune (daily) to the scheduler. You only need schedule:run and a queue worker. To schedule them yourself, set vitals.schedule to false.

Command Purpose
vitals:dispatch {--all} Put the checks that are due on the queue
vitals:run {check?} {--tenant=} Run checks synchronously and print a table
vitals:list List the registered checks with their schedule
vitals:prune {--days=} Delete results older than vitals.retention_days

Give Vitals its own queue (VITALS_QUEUE=vitals), so a busy default queue does not delay the checks.

Dashboard access

Access is decided in this order:

  1. A callback, if you set one: Vitals::auth(fn (Request $request) => …).
  2. Otherwise the viewVitals gate, if it is defined.
  3. Otherwise only the local environment.

status.json also accepts the X-Vitals-Token header when VITALS_STATUS_TOKEN is set. It returns 503 when a check has failed, crashed or gone stale, or when the dispatcher has not run for 3 minutes. A check counts as stale when it has not reported for twice its interval plus 5 minutes.

Muting

From the dashboard you can mute a known problem, so it no longer counts in the totals or in status.json, while its real status stays visible. You can mute four things:

A mute lasts for a fixed period (1 hour up to 1 week), until the muted checks recover, or until you unmute it. You can add a reason, and the overview lists every active mute. status.json reports muted problems under muted instead of problems. The events carry a muted flag, so your own notifications can skip them.

Muting during a deploy

Mute everything at the start of a deploy and lift it at the end, so short hiccups don't page anyone:

vitals:mute {check?} {--tenant=} {--central} {--all} {--for=15m|2h|1d} {--until-recovered} {--reason=} and vitals:unmute {id?*} {--reason=} {--all}.

Dashboard

Tenancy

With stancl/tenancy installed, Vitals uses StanclTenancyAdapter. For each tenant it initializes tenancy once, runs all due checks, and ends tenancy in a finally block. If the tenant cannot be initialized, or its database cannot be reached, every check of that tenant is recorded as crashed with "Tenant could not be initialized". Results are always written to the central connection.

For any other tenancy package, implement NetOs\Vitals\Tenancy\TenancyAdapter (tenants(), find() and run()) and set vitals.tenancy.adapter to your class.

Events

Development

The workbench has three stancl tenants. Acme has a failing sync, Globex has a pending migration and Northwind has no database. It also contains seven days of history.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-vitals with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package net-os/laravel-vitals contains the following files

Loading the files please wait ...