Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
neemspees committed Aug 17, 2023
1 parent b676f78 commit 60676b3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
60 changes: 23 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,46 @@
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/libaro-io/laravel-monitoring/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/libaro-io/laravel-monitoring/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/libaro-io/laravel-monitoring.svg?style=flat-square)](https://packagist.org/packages/libaro-io/laravel-monitoring)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

## Support us

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-monitoring.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-monitoring)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
The Libaro monitoring package, a config based monitoring setup for your Laravel applications.

## Installation

You can install the package via composer:
You can install the package using composer:

```bash
composer require libaro-io/laravel-monitoring
```

You can publish and run the migrations with:
## Configuration

```bash
php artisan vendor:publish --tag="laravel-monitoring-migrations"
php artisan migrate
```
### Publishing the configuraiton

You can publish the config file with:
You can publish [the config file](./config/monitoring.php) with:

```bash
php artisan vendor:publish --tag="laravel-monitoring-config"
```

This is the contents of the published config file:

```php
return [
];
php artisan vendor:publish --tag="monitoring-config"
```

Optionally, you can publish the views using
### Queue monitoring

```bash
php artisan vendor:publish --tag="laravel-monitoring-views"
```
You can enable queue monitoring by specifying your queue name as an array key followed by the configuration for that queue.

## Usage
| Option | Value | Description |
|------------------|:-------:|------------------------------------------------------------------------------------------------------------------------------------|
| max_wait_minutes | int | A test job will be dispatched on that queue. When the job is not processed within the specified time, a notification will be sent. |

```php
$laravelMonitoring = new Libaro\LaravelMonitoring();
echo $laravelMonitoring->echoPhrase('Hello, Libaro!');
```

## Testing

```bash
composer test
[
...

'queue' => [
'invoicing' => [ // queue name
'max_wait_minutes' => 5, // Fails when test job is not processed within 5 minutes
],
],

...
]
```

## Changelog
Expand All @@ -78,6 +63,7 @@ Please review [our security policy](../../security/policy) on how to report secu

- [Kim Bouchouaram](https://github.com/neemspees)
- [All Contributors](../../contributors)
- [Spatie](https://spatie.be/) (Package Skeleton, Laravel Health)

## License

Expand Down
24 changes: 19 additions & 5 deletions config/monitoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

// config for Libaro/LaravelMonitoring
return [
/*
|--------------------------------------------------------------------------
| Queue Monitors
|--------------------------------------------------------------------------
|
| This section defines which queues are monitored and which values will
| trigger a notification, the notifications will be sent through the
| health package, consult the health config section for more info.
|
*/

'queue' => [
'default' => [
// A test job will be dispatched every minute, when it didn't run for longer
// this value, a notification will be triggered
'max_wait_minutes' => 5,
],
// 'default' => [
// 'max_wait_minutes' => 5,
// ],
],


Expand All @@ -20,6 +29,11 @@
| You can choose, either change your health configuration here or in the
| spatie packages health.php, this one has precedence over health.php.
|
|
| To consult spatie/laravel-health documentation, please visit the webpage
| https://spatie.be/docs/laravel-health/v1, all configuration available
| for it can be overridden here, there is no need to use their files.
|
*/

'health' => [
Expand Down

0 comments on commit 60676b3

Please sign in to comment.