Skip to content

Conversation

@cto-new
Copy link

@cto-new cto-new bot commented Oct 20, 2025

Summary

This PR adds operational endpoints for readiness and runtime observability including Prometheus-compatible metrics and detailed health checks.

Details

  • Implements /healthz endpoint: checks DB connectivity, Chroma vector store, and background worker liveness with build/version info; supports optional auth.
  • Implements /metrics endpoint for Prometheus metrics (HTTP, pipeline, queue sizes) with multiprocess safety; metrics are updated via middleware and monitoring hooks.
  • Integrates Prometheus client, metrics registry, and low-cardinality labeling; ensures metrics endpoint is lightweight.
  • Documents all endpoints in OpenAPI and provides minimal, direct tests for endpoint and metrics exposure.
  • Adds prometheus_client as a required dependency; refactors FastAPI startup and middleware to inject metrics.

…eus integration

This change introduces new operational endpoints for readiness and observability. The FastAPI app now exposes a /healthz endpoint with detailed component checks, and a /metrics endpoint compatible with Prometheus. The middleware records HTTP and pipeline metrics. All endpoints are documented and guarded by optional authentication if configured. Basic tests ensure endpoint and metric exposure, and Prometheus multi-process mode is supported for worker setups.

- Adds /healthz with DB, Chroma, and worker liveness checks
- Adds /metrics with HTTP and pipeline Prometheus metrics
- Middleware tracks request counters/histograms
- Endpoints are tested, and build/version info is shown

BREAKING CHANGE: Prometheus is now a required dependency and endpoints /healthz and /metrics are reserved.
@cto-new cto-new bot merged commit 0f0b854 into main Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant