Download the PHP package kiora/health-check-bundle without Composer

On this page you can find all versions of the php package kiora/health-check-bundle. 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 health-check-bundle

Health Check Bundle

A Symfony bundle providing comprehensive health check functionality for monitoring application dependencies and services.

CI codecov PHPStan Level 9

Latest Stable Version Total Downloads License

PHP Version Symfony Version

Why use this bundle?

Production-Ready & Battle-Tested

Enterprise-Grade Features

Developer-Friendly

Features

Development with Docker

The project includes a complete Docker environment for development and testing.

Quick Start

Available Services

Manual Commands

If you prefer not to use Make:

Installation

1. Install the bundle

2. Enable the bundle

If Symfony Flex is not installed, manually add the bundle to config/bundles.php:

3. Import routes

Create config/routes/health_check.yaml:

4. Configure security access

Add public access to the health check endpoint in config/packages/security.yaml:

5. (Optional) Configure rate limiting

Create config/packages/rate_limiter.yaml:

Install required packages:

Configuration

Basic Configuration

Create config/packages/health_check.yaml:

Built-in Checks

1. Database Check (Auto-registered)

Automatically enabled - Verifies database connectivity using Doctrine DBAL.

No additional configuration needed. Works out of the box with your existing Doctrine configuration.

Multiple Database Connections

If your application uses multiple database connections (e.g., read/write replicas, analytics database, logs database), you can configure separate health checks for each connection:

Naming Convention:

Configuration Options:

2. Redis Check (Manual setup)

⚙️ Disabled by default - Only configure if your project uses Redis.

Step 1: Enable in configuration

Step 2: Configure the service

Create or update config/packages/health_check.yaml:

Step 3: Add environment variables

3. S3/MinIO Storage Check (Manual setup)

⚙️ Requires manual configuration - Only configure if your project uses S3/MinIO storage.

Example for multiple buckets:

4. HTTP Endpoint Check (Manual setup)

⚙️ For monitoring external dependencies - Configure for each external API you depend on.

Example: Microsoft Graph API

Usage

Available Endpoints

The bundle provides three distinct endpoints for different monitoring purposes:

1. /ping - Liveness Probe (Lightweight)

A simple endpoint that verifies the application is running without checking any external dependencies.

Response:

Use case: Kubernetes liveness probes, load balancer health checks

Characteristics:

2. /ready - Readiness Probe (Critical Dependencies)

Checks if the application is ready to serve traffic by verifying critical dependencies in the "readiness" group.

Response:

Use case: Kubernetes readiness probes, determining when pods should receive traffic

Characteristics:

3. /health - Comprehensive Health Check

Provides complete health status of all configured health checks, optionally filtered by group.

Use case: Monitoring dashboards, alerting systems, comprehensive health status

Characteristics:

Endpoint Comparison

Feature /ping /ready /health
Purpose Is app running? Can serve traffic? Overall health
Dependencies Checked None Readiness group only All or filtered by group
Response Time Instant Fast Depends on checks
Kubernetes Use Liveness probe Readiness probe Monitoring
HTTP 503 on Failure Never Yes Yes
Group Filtering No Fixed (readiness) Yes (?group=)

Configuring Health Checks for Readiness

To mark health checks as critical for readiness probes, assign them to the "readiness" group:

Response Format

Statistics Breakdown

The statistics section provides performance insights:

Status Codes

Check Status Values

Filtering Checks by Group

Health checks can be organized into groups/contexts (e.g., web, worker, console) to enable granular monitoring based on the application context.

Using the Group Query Parameter

Filter health checks by group using the ?group= query parameter:

Configuring Groups

Assign groups to health checks in your service configuration:

Group Filtering Behavior

Use Cases

Kubernetes Probes:

Console Commands:

Monitoring Different Environments:

Creating Custom Health Checks

1. Create your check class

Simply implement HealthCheckInterface or extend AbstractHealthCheck. No manual tagging required!

2. Register your check

If you have autowire: true and autoconfigure: true in your services.yaml (default in modern Symfony):

How it works: All classes implementing HealthCheckInterface are automatically tagged with health_check.checker thanks to the #[AutoconfigureTag] attribute on the interface. No manual tagging needed!

Configuration Options:

Security Considerations

What's Included ✅

What's NOT Included ❌

Best Practices

  1. Enable rate limiting to prevent abuse
  2. Use IP whitelisting for production environments if possible
  3. Monitor access logs to detect reconnaissance attempts
  4. Keep checks non-critical unless absolutely necessary
  5. Avoid exposing internal service names in check names

Monitoring Integration

Kubernetes Liveness and Readiness Probes

Kubernetes distinguishes between two types of health checks:

Recommended Configuration

Probe Configuration Explained

Liveness Probe (/ping):

Readiness Probe (/ready):

Why Separate Endpoints?

Problem with using /health for both:

Issues:

  1. If database is temporarily unavailable, pod gets restarted (liveness)
  2. Unnecessary restarts can cause cascading failures
  3. No distinction between "app is running" and "app can serve traffic"

Solution with separate endpoints:

Benefits:

  1. Database issues remove pod from service (readiness) but don't restart it (liveness)
  2. Pod has time to recover from transient failures
  3. Clear separation of concerns
  4. Follows Kubernetes best practices

Context-Specific Health Checks

For different deployment types, use the ?group= parameter:

Docker Healthcheck

Prometheus/Grafana

The JSON response can be easily parsed and converted to metrics for monitoring dashboards.

Troubleshooting

Health check returns 404

Check always returns "unhealthy"

Rate limiting errors

Redis check not working

Requirements

Optional Dependencies

Configuration Reference

Complete Example

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

Code Quality

This project uses GrumPHP to ensure code quality. All checks are run automatically before each commit:

Coding Standards

Support

License

This bundle is released under the MIT License.

Credits

Created and maintained by Kiora Tech.

Changelog

Unreleased

1.0.0 (2025-11-06)


All versions of health-check-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/framework-bundle Version ^6.4|^7.0|^8.0
symfony/dependency-injection Version ^6.4|^7.0|^8.0
symfony/config Version ^6.4|^7.0|^8.0
symfony/http-kernel Version ^6.4|^7.0|^8.0
symfony/routing Version ^6.4|^7.0|^8.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 kiora/health-check-bundle contains the following files

Loading the files please wait ...