feat: add Prometheus metrics + fix CI/CD health check port
- Add prometheus-client dependency - Create middleware/metrics.py with PrometheusMiddleware - Expose /metrics endpoint in Prometheus text format - Track http_requests_total, translation_total, translation_duration_seconds, file_size_bytes - Instrument translate routes with record_translation() and record_file_size() - Fix deploy.yml health check: localhost:8000 -> localhost:8001 (Portainer conflict) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
# Final health check on backend
|
||||
for i in $(seq 1 10); do
|
||||
if curl -sf http://localhost:8000/health > /dev/null 2>&1; then
|
||||
if curl -sf http://localhost:8001/health > /dev/null 2>&1; then
|
||||
echo "Backend health check: OK"
|
||||
break
|
||||
fi
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
echo "========================================="
|
||||
docker compose ps
|
||||
echo ""
|
||||
echo "Health: $(curl -sf http://localhost:8000/health 2>/dev/null || echo 'FAILED')"
|
||||
echo "Health: $(curl -sf http://localhost:8001/health 2>/dev/null || echo 'FAILED')"
|
||||
echo "========================================="
|
||||
|
||||
# Optional: deploy monitoring stack
|
||||
|
||||
Reference in New Issue
Block a user