The API starts without logging, metrics or request IDs if their imports fail, and records no reason

Abierto
#1,041 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
prometheus, python

Línea de trabajo

Start with backend/app/main.py around lines 30-48, where the monitoring imports and exception handling are defined, and inspect the /health/ready endpoint. First determine which logging, metrics, and request-ID components are required outside development and test, then preserve the failed exception for optional components and expose degraded readiness. Add a test that makes each import fail and verifies whether startup stops or readiness reports degraded.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug post-launch

backend/app/main.py (lines ~30-48) imports the logging setup, the Prometheus middleware and the request-ID middleware inside try: ... except Exception: _monitoring_imports_ok = False (marked # pragma: no cover). If any of those imports fails, the API starts without structured logging, metrics or request IDs, and nothing records why: the exception is discarded.

Expected: decide which of these are optional. A failure to import a required one stops startup outside development/test (as a broken module install already does); an optional one logs the exception and shows up in /health/ready as degraded. A test imports main with one of them made to fail and checks the result. Found in a code review (2026-10-06).

Lenguaje dominante
Python
Estrellas
0
Forks
4
Merge medio
5 h 19 min
PR fusionados (30 d)
503

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Controlvar/controlvar

Todos los issues de Controlvar/controlvar

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.