Observability: Cron enhancements
Los mantenedores suelen responder en 1 día
@vprashrex ya está trabajando en esto.
Desde el 23/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Is your feature request related to a problem?
The current design excludes /cron/* endpoints from tracing, making it difficult to track what a cron run processes since Celery tasks appear as separate root traces. Additionally, failing runs incorrectly report as successful due to the handling of exceptions in process_all_pending_evaluations.
Describe the solution you'd like
- Trace only when there's actual work, opening spans after polling for pending runs while keeping
/cronexcluded. - Implement error monitoring for runs that end with
status: errorto correctly report failures in Sentry. - Include span attributes like pending run count and processing status for clarity.
- Ensure consistent timezone settings across monitor configurations.
- Create tests to validate span existence with pending runs and error reporting for failed runs.
Original issue
Problem
/cron/* endpoints are excluded from tracing on purpose, so an idle cron run doesn't create a trace every minute. The downside is that Celery tasks the cron enqueues (send_eval_completion_notification, fast-eval barriers, iteration resumes) have no parent span and each one shows up as its own root trace. You can't see in one place what a cron run actually processed.
There's a second gap: process_all_pending_evaluations catches every exception and returns {"status": "error"}, so the @sentry_sdk.monitor check-in still reports OK when the run failed.
What we'll do
- Trace only when there's real work. Keep
/cronexcluded. Open a span (evaluation.cron.poll,evaluation.cron.poll_stt/poll_tts, plus fast-barrier and iteration-resume dispatch) only after a poll finds pending runs. Tasks enqueued inside nest under it; idle runs produce no trace.crud/evaluations/processing.py→poll_all_pending_evaluationscrud/evaluations/cron_utils.py→poll_all_pending_evaluations_by_typecrud/evaluations/cron.py→ fast-eval barrier and iteration-resume dispatch
- Report real failures to the cron monitor. When a run ends with
status: error, send an error check-in (re-raise, orcapture_checkin(..., status=MonitorStatus.ERROR)), so Sentry marks the run failed instead of OK. - Span attributes worth having: pending run count, processed / failed / still-processing counts, so a cron trace explains itself.
- Consistent timezone across monitor configs (evaluations uses
UTC, the othersAsia/Kolkata). - Tests: span exists only when there are pending runs; failed run sends an error check-in.
What Sentry Crons gives us (besides uptime)
@monitor/with monitor(...)withmonitor_configto create or update the monitor from code (already used inapi/routes/cron.py).monitor_config:schedule(crontab or interval),checkin_margin,max_runtime,failure_issue_threshold,recovery_threshold,timezone.- Check-in statuses
in_progress/ok/error, plus manualcapture_checkin(monitor_slug, check_in_id, status)for jobs that can't use the decorator. - Missed, failed and timed-out runs become Issues, with per-monitor alerting.
- Monitor environments: check-ins are tracked per environment (production / staging).
CeleryIntegration(monitor_beat_tasks=True, exclude_beat_tasks=[...])auto-monitors Celery Beat tasks. Not used today because our crons are HTTP-triggered, but an option if they move to Beat.
Out of scope
Uptime monitors, and moving crons to Celery Beat.
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 11
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ProjectTech4DevAI/kaapi-backend
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ProjectTech4DevAI/kaapi-backend#889 ·
Los mantenedores suelen responder en 1 día
-
Sentry: Add module and version tagsPosiblemente ocupada @vprashrex la tomó hoy. Abierto
ProjectTech4DevAI/kaapi-backend#1305 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Otel: Standardize key constantsPosiblemente ocupada @vprashrex la tomó hace 3 días. Abierto
ProjectTech4DevAI/kaapi-backend#1294 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Chabot: Server-side chatbot state managementPosiblemente ocupada @Ayush8923 la tomó hace 4 días. Abierto
ProjectTech4DevAI/kaapi-backend#1278 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Monitoring: Enhance alerting and securityPosiblemente ocupada @Ayush8923 la tomó hace 7 días. Abiertoinfrastructure
ProjectTech4DevAI/kaapi-backend#1271 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de ProjectTech4DevAI/kaapi-backend
Issues similares
-
Project submission:Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slavakurilyak/awesome-ai-agents#845 ·
Los mantenedores suelen responder en 1 día
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodifficulty:2 enhancement good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
MakazhanAlpamys/Soup#2178 ·
Los mantenedores suelen responder en 1 día
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
scverse/rapids-singlecell#854 ·
Los mantenedores suelen responder en 1 día
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLPosiblemente ocupada @ninglinLiu la tomó hoy. Abiertoarea:frontend backend:slang bug direction:input
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 13 días