承接 govigilant/drupal-healthchecks 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

govigilant/drupal-healthchecks

最新稳定版本:1.0.0

Composer 安装命令:

composer require govigilant/drupal-healthchecks

包简介

A Drupal module that exposes Vigilant-compatible health information.

README 文档

README

Banner

Vigilant Drupal Healthchecks

Tests Analysis Total downloads

A package that adds healthchecks to any Drupal application and integrates seamlessly with Vigilant.

Installation

Install the module with Composer:

composer require govigilant/drupal-healthchecks

Enable the module via the Drupal UI or with Drush:

drush en vigilant_healthchecks -y && drush cr

Configure the bearer token and thresholds at Configuration → System → Vigilant Healthchecks once the module is enabled.

Usage

Accessing the health endpoint

After configuring a bearer token, the health payload is available at:

POST /vigilant/health

Example curl request:

curl -X POST "https://your-drupal-site.test/vigilant/health" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"

Available Checks

Check Description
DatabaseCheck Executes a lightweight query to confirm the default database connection responds.
CacheCheck Writes and reads a payload using the cache backend to ensure it can store, retrieve, and delete items.
QueueCheck Pushes a probe job through Drupal's queue backend to verify processing behavior and report backlog snapshots.
CronCheck Ensures Drupal cron has executed within the configurable threshold stored in vigilant_healthchecks.settings.
SecurityUpdatesCheck Uses the Update Manager data to flag projects with outstanding security advisories.

Available Metrics

Metric Description
CacheEfficiencyMetric Aggregates hit/miss ratios for the cache bins listed in vigilant_healthchecks.settings.
ErrorLogMetric Counts watchdog error entries recorded within the configurable rolling window.

Extending

You can register your own health checks or metrics by tagging services with vigilant_healthchecks.check or vigilant_healthchecks.metric.

  1. Create a class that extends Vigilant\HealthChecksBase\Checks\Check (or Metric) and implement run()/measure() plus available().
  2. Define the service in MODULE.services.yml and add the appropriate tag.
  3. Inject any dependencies as usual; the HealthCheckRegistry automatically discovers tagged services.
services:
  my_module.check.custom_backend:
    class: Drupal\my_module\Checks\CustomBackendCheck
    arguments:
      - '@my.service'
    tags:
      - { name: vigilant_healthchecks.check }

Development Environment

A ready-to-use Docker Compose setup lives in devenv/. Start the stack: docker compose -f devenv/docker-compose.yml up --build.

This provisions Drupal 11 with MariaDB, installs this module automatically, and exposes the site on http://localhost:8000. The default admin credentials are admin / secret and the bearer token is preset to testing.

Stop everything with docker compose -f devenv/docker-compose.yml down -v when you're done.

Quality

Run the quality checks locally:

composer quality

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-26