Commit Graph

4 Commits

Author SHA1 Message Date
auto-bot
6f4793a330 feat: add comprehensive health checks and Prometheus metrics
- Add app/health.py with HealthChecker and MetricsCollector classes
- Implement composite /health endpoint checking DB and HTTP client
- Add /metrics endpoint with Prometheus exposition format
- Add webhook request metrics (counters, histograms, gauges)
- Create app/http_client.py for shared AsyncClient management
- Update app/main.py lifespan to init/close HTTP client
- Add comprehensive tests in tests/test_health.py

This enables proper observability with health checks and metrics
for monitoring system status and webhook processing performance.
2025-12-24 11:10:54 +08:00
auto-bot
b11c39f3bf feat: add async retry mechanism with exponential backoff
- Add app/utils/retry.py with configurable async retry decorator
- Update DeliveryLog model to track attempt_count and latency_seconds
- Apply @http_retry to engine._exec_forward and _exec_notify methods
- Update save_logs to record retry metadata
- Add comprehensive unit tests for retry functionality
- Support configuration via environment variables (RETRY_*)

This improves reliability for downstream HTTP calls by automatically
retrying transient failures with exponential backoff and jitter.
2025-12-24 11:04:41 +08:00
auto-bot
74b8b8e8ed feat: replace str.format with safe_render; add Pydantic validation to webhook route 2025-12-24 10:53:15 +08:00
auto-bot
ec58508476 feat: add safe_render using Jinja2; add tests 2025-12-24 10:50:34 +08:00