Send swallowed auth/migration DB errors to Sentry, and stop reporting routine 4xx
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- backend, observability-sre
Direzione di ricerca
Inizia con l’hook onError in platform/src/server.ts:30-32, poi esamina gli errori ignorati in server.ts:48 e in instance-auth.ts:139 e :275. Leggi gli usi esistenti di captureException in instance-auth.ts e l’implementazione in platform/src/util/sentry.ts. Il lavoro è completato quando tutti e tre gli errori DB vengono catturati, gli errori 4xx di routine vengono ignorati e i log e le risposte HTTP esistenti rimangono invariati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Two related problems with how we report errors to Sentry.
First, three database failures in the client-auth path get logged with console.error and then forgotten. They never reach Sentry, so we're blind to them in production.
Second, the Elysia onError hook sends every error to Sentry, including routine 4xx like favicon bots hitting NOT_FOUND. That noise buries the errors we actually care about.
They sit in overlapping code, so it's easier to fix them together.
1. Capture the three swallowed DB errors. Each one currently console.errors and moves on:
platform/src/server.ts:48— migration run failure (runMigrations()).platform/src/auth/instance-auth.ts:139— startup DB-probe (reachability) failure; auth degrades to the shape-checked forward path.platform/src/auth/instance-auth.ts:275— runtime client-lookup failure; request fails closed.
Each of these needs an explicit captureException(err, …) next to the log it already writes. captureException is already imported in instance-auth.ts:7 and used elsewhere in that file (lines 158, 251, 312), so those two sites are just inconsistent with the rest of it. server.ts needs the import adding (import { captureException } from "./util/sentry").
2. Skip 4xx in the onError hook. Request errors only reach Sentry through the onError hook at platform/src/server.ts:30-32, and it calls captureException(error) for everything. Add a status check so we only capture 5xx and unexpected errors, and skip the routine 4xx like NOT_FOUND. Elysia hands us the error code and status on the onError context, so the guard lives right there in the hook.
Sentry is wired in platform/src/util/sentry.ts (captureException is a no-op when SENTRY_DSN is unset) and initialised from platform/src/index.ts:4.
Acceptance criteria
- Migration failure at
platform/src/server.ts:48callscaptureException, with the import added toserver.ts. - Startup DB-probe failure at
platform/src/auth/instance-auth.ts:139callscaptureException. - Runtime client-lookup failure at
platform/src/auth/instance-auth.ts:275callscaptureException. - The
onErrorhook (platform/src/server.ts:30-32) only captures 5xx/unexpected errors; 4xx (e.g.NOT_FOUND) is skipped. - No behaviour change to the HTTP responses themselves —
onErrorstill returns nothing so Elysia produces its normal error body/status. - Existing log lines retained; Sentry capture is additive.
- Lingua principale
- Jupyter Notebook
- Stelle
- 5
- Fork
- 10
- Merge medio
- 2g 12h
- PR unite (30g)
- 17
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenFn/apollo
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 5 giorni
-
Apollo 3.3.0 is stalledAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
OpenFn/apollo#696 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di OpenFn/apollo
Issue simili
-
priority: low 🌱 type: enhancement 💅🏼
Difficoltà 2/5 Mezza giornata Idoneità per principianti 84/100
nebari-dev/llm-serving-pack#199 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
linebender/parley#849 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rohitg00/agentmemory#1428 ·
I maintainer di solito rispondono entro 1 giorno