Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow Health Check System

From Leeroopedia
Knowledge Sources
Domains DevOps, Observability
Last Updated 2026-02-12 06:00 GMT

Overview

Concrete tool for verifying deployment health across all system components provided by RAGFlow's health check system.

Description

The run_health_checks() function tests four components: database (SELECT 1), Redis (REDIS_CONN.health()), document store (docStoreConn.health()), and storage (STORAGE_IMPL.health()). Results are exposed via GET /healthz (detailed) and GET /ping ("pong" response).

Usage

Access via HTTP endpoints after deployment.

Code Reference

Source Location

  • Repository: ragflow
  • File: api/apps/system_app.py (L174-183), api/utils/health_utils.py (L34-338)

Signature

def run_health_checks() -> tuple[dict, bool]:
    """Run all health checks.

    Returns:
        tuple[dict, bool] - (results_dict, all_healthy)
        results_dict: {
            "status": "ok"|"nok",
            "db": "ok"|"nok",
            "redis": "ok"|"nok",
            "doc_engine": "ok"|"nok",
            "storage": "ok"|"nok",
            "_meta": {...}
        }
    """

@manager.route("/healthz", methods=["GET"])
def healthz():
    """Health check endpoint. Returns 200 if healthy, 500 if any component fails."""

@manager.route("/ping", methods=["GET"])
def ping():
    """Liveness check. Always returns "pong"."""

Import

from api.utils.health_utils import run_health_checks

I/O Contract

Inputs

Name Type Required Description
(none) - - Uses initialized settings connections

Outputs

Name Type Description
/healthz JSON Component-level health status
/ping text "pong" string

Usage Examples

# Check deployment health
curl http://localhost:9380/healthz
# {"status":"ok","db":"ok","redis":"ok","doc_engine":"ok","storage":"ok"}

# Simple liveness check
curl http://localhost:9380/ping
# pong

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment