2017 © Pedro Peláez
 

library healthchecks-bundle

Bundle for integration with healthchecks.io cron monitoring service

image

prgtw/healthchecks-bundle

Bundle for integration with healthchecks.io cron monitoring service

  • Tuesday, June 26, 2018
  • by prgTW
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,896 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 17 Versions
  • 23 % Grown

The README.md

HealthchecksBundle

Dependency Status Packagist Packagist, (*1)

Bundle enables integration with healthchecks.io., (*2)

TODO:

  • [ ] implement concurrent requests

Installation

  1. Require the prgtw/healthchecks-bundle package in your composer.json and update your dependencies., (*3)

    composer require prgtw/healthchecks-bundle
    
  2. Add the HealthchecksBundle to your application's kernel:, (*4)

    ```php public function registerBundles() { $bundles = [ // ... new prgTW\HealthchecksBundle(), // ... ]; // ... } ````, (*5)

Configuration

Example configuration:, (*6)

healthchecks:
    api:
        clients:
            example: "api-key-here"
    timezone: "Europe/Warsaw" # default timezone to use for checks
    checks:
        simple:
            client: example
            name: "Simple hourly check"
            timeout: 3600
            tags: [simple, all]
        cron:
            client: example
            name: "Cron-based check"
            schedule: "*/30 * * * *"
            timezone: UTC
            tags: [cron, all]

Usage

$api = $container->get('healthchecks.api');

// setup checks on healthchecks.io side according to configuration
$api->setup('simple');
$api->setupMany(['simple', 'cron']);

// ping check(s)
$api->ping('simple');
$api->pingMany(['simple', 'cron']);

// pause check(s)
$api->pause('simple');
$api->pauseMany(['simple', 'cron']);

Providing checks data at runtime

To provide checks data at runtime you have to create your own resolver, and you have to configure bundle to use this resolver instead of default one, (*7)

For example:, (*8)

namespace App\Healthchecks\Resolver;

use prgTW\HealthchecksBundle\Resolver\ResolverInterface;

class CustomResolver implements ResolverInterface
{
    public function resolve()
    {
        // Get the data from your source and map your array in such format: 
        return [
            'backup_task'  => [
                'name'     => 'Backup task',
                'schedule' => '15 2 * * *',
                'client'   => 'dev',
                'tags'     => ['backup', 'devops'],
                'unique'   => ['name', 'tags'],
            ],
            'cleanup_task' => [
                'name'     => 'Cleanup task',
                'schedule' => '0 3 * * *',
                'client'   => 'dev',
                'tags'     => ['backup', 'devops'],
                'unique'   => ['name', 'tags'],
            ],
        ];
    }

    public function resolveNames(): array
    {
        return ['backup_task', 'cleanup_task'];
    }
}
services:
    healthchecks.resolver.custom:
        class: "App\\Healthchecks\\Resolver\\CustomResolver"
healthchecks:
    api:
        clients:
            example: "api-key-here"
    timezone: "Europe/Warsaw" # default timezone to use for checks
    resolver: "healthchecks.resolver.custom" #Service ID of your custom resolver 

The Versions

26/06 2018
28/08 2017

0.3.2

0.3.2.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

29/06 2017

0.3.1

0.3.1.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

30/05 2017

0.3.0

0.3.0.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

30/05 2017

0.2.3

0.2.3.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

28/05 2017

0.2.2

0.2.2.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

27/05 2017

0.2.1

0.2.1.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

27/05 2017

0.2.0

0.2.0.0

Bundle for integration with healthchecks.io cron monitoring service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony cron monitoring healthchecks

14/05 2017

0.1.4

0.1.4.0

Bundle for integration with healthchecks.io

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony expectation healthchecks

14/05 2017

0.1.3

0.1.3.0

Bundle for integration with healthchecks.io

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony expectation healthchecks

14/05 2017

0.1.2

0.1.2.0

Bundle for integration with healthchecks.io

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony expectation healthchecks

14/05 2017

0.1.1

0.1.1.0

Bundle for integration with healthchecks.io

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony expectation healthchecks

14/05 2017

0.1.0

0.1.0.0

Bundle for integration with healthchecks.io

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tomasz Wójcik

bundle symfony expectation healthchecks