feat(health-checks): enhance health check configuration and logging
quality / commitlint (push) Skipped
CD / update-wiki (push) Successful in 8s
quality / changes (push) Successful in 5s
quality / docker-check (push) Skipped
quality / web (push) Successful in 51s
quality / api (push) Successful in 44s
CD / quality (push) Successful in 1m44s
CD / publish (push) Successful in 1m35s
quality / commitlint (push) Skipped
CD / update-wiki (push) Successful in 8s
quality / changes (push) Successful in 5s
quality / docker-check (push) Skipped
quality / web (push) Successful in 51s
quality / api (push) Successful in 44s
CD / quality (push) Successful in 1m44s
CD / publish (push) Successful in 1m35s
- Added new health worker URL and token fields to the AppConfig interface, allowing for Cloudflare Worker integration. - Updated health check routes to utilize the new worker configuration, enabling dynamic health checks via Cloudflare Workers. - Introduced a health log endpoint for services, providing detailed logs of health probe results. - Enhanced health check service logic to support both local and Cloudflare Worker providers, improving flexibility in health monitoring. - Updated UI components to reflect changes in health check provider settings and display relevant health information. This commit significantly improves the health check management capabilities, allowing for better integration with Cloudflare Workers and enhanced logging features.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# CFDM health-probe Worker
|
||||
|
||||
Stateless edge probe for CFDM. **Not** Cloudflare Health Checks API (unavailable on Free).
|
||||
Cron stays in CFDM — this Worker has no Cron Trigger.
|
||||
|
||||
## Deploy
|
||||
|
||||
```powershell
|
||||
cd workers/health-probe
|
||||
npx wrangler login
|
||||
npx wrangler secret put PROBE_TOKEN
|
||||
npx wrangler deploy
|
||||
```
|
||||
|
||||
Paste the Worker URL (`https://cfdm-health-probe.<account>.workers.dev`) and the same token into **Настройки → Health-check**.
|
||||
|
||||
Free Workers ≈ 100k requests/day. CFDM cron every 2 minutes × number of IPs must fit.
|
||||
|
||||
## API
|
||||
|
||||
`POST /probe` + `Authorization: Bearer <PROBE_TOKEN>`
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "tcp",
|
||||
"ip": "1.2.3.4",
|
||||
"hostname": "app.example.com",
|
||||
"port": 443,
|
||||
"path": "/",
|
||||
"expected_status": 200,
|
||||
"timeout_ms": 3000,
|
||||
"verify_tls": true,
|
||||
"method": "GET"
|
||||
}
|
||||
```
|
||||
|
||||
Response: `{ "ok": true, "latencyMs": 42, "error": null, "colo": "AMS" }`.
|
||||
Reference in New Issue
Block a user