New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adata-team/healthchecker

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adata-team/healthchecker

Package for check some services to health

Source
Packagist
Version
v2.3.0
Version published
Total downloads
20K
Maintainers
1
Created
Source

Health check library

PHP Latest version Stars Downloads Contributors Release

Quick start for Lumen/Laravel application

1. Install via composer:

composer require adata-team/healthchecker

2. Make configuration file in config/health.php with content

<?php

return [
    'router' => [
        'group_prefix' => 'health',
        'check_prefix' => 'check',
        'check_name'   => 'healthCheck',
        'url'          => '/health/check',
    ],
];

The above code is the minimum to run this plugin.

group_prefix - the name of the route group, for health
check_prefix - health route prefix
check_name   - route name
url          - url where healthcheck will be available

See full documentation in Examples folder

3. Register service provider in Lumen bootstrap/app.php

$app->register(Adata\HealthChecker\HealthCheckerProvider::class);

and register configuration file

$app->configure('health');

Parameters in configuration file

NAMEDESCRIPTIONREQUIREDTYPEDEFAULTEXAMPLE
app_nameApplication name to display in health checkfalsestringenv[APP_NAME]'Project'
show_hostShow host (URL of the current project)falseboolfalsetrue
precision_timeRounding of time to n digitsfalseint24
show_hostnameShow server namefalseboolfalsetrue
enable_time_checkEnable healthCheck runtime meteringfalseboolfalsetrue
enable_color_statusEnable display of health status [red, yellow, green]falseboolfalsetrue
enable_server_timeEnable server time display (Carbon::now())falseboolfalsetrue
allowed_cluster_healthValid elasticsearch cluster states [red, yellow, green]falsearray[green][yellow, green]
class_mapCheckers class mapfalsearray[]['database' => Adata\HealthChecker\Checkers\DatabaseChecker::class]
routerRouting settingstruearray-['group_prefix' => 'health', 'check_prefix' => 'check', 'check_name' => 'healthCheck', 'url' => '/health/check']
servicesServices to checkfalsearray-['db' => ['type' => 'database', 'connections' => ['pgsql']]

Configuration services to check

RabbitMQ configuration params

  • type = rabbitmq
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
hostServer hosttruestring-
portConnection portfalseint15672
userUsertruestring-
passwordPasswordtruestring-
timeoutTimeoutfalseint3

Redis configuration params

  • type = redis
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
hostServer hosttruestring-
portConnection portfalseint6379
userUsertruestring-
timeoutConnection timeoutfalseint3

Database configuration params

  • type = database
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
connectionsArray naming connectionsfalsearray.env[DB_CONNECTION]
timeoutConnection timeoutfalseint3

HealthCheck configuration params

  • type = healthCheck
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
urlURL health checktruestring-
timeoutConnection timeoutfalseint3

HTTP configuration params

  • type = http
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
urlURL where to check the 200 response statustruestring-
timeoutConnection timeoutfalseint3

ElasticSearch configuration params

  • type = elastic
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
hostsElastic hosts to check (Format: "host:port")truearray-
timeoutConnection timeoutfalseint3

FileServer configuration params

  • type = fileServer
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
mounted_pathThe path where the file server is mountedtruestring-
dirDirectory to check for existencetruestring-

Arango configuration params

  • type = arango
NAMEDESCRIPTIONREQUIREDTYPEDEFAULT
hostServer host arangotruestring-
portConnection portfalseint8529
httpsEnable https protocolfalseboolfalse
databaseArango database name for the testtruestring-
timeoutConnection timeoutfalseint3

Keywords

redis

FAQs

Package last updated on 15 Apr 2025

Related posts