Context
src/selfhost/sentry.ts documents this codebase's console-forwarding convention: console.error is forwarded to Sentry by default; console.log needs an explicit level:"error"/"fatal" field to be forwarded at all.
Four catch blocks in src/review/rag.ts (embedTexts ~line 303 rag_embed_error, upsertChunks ~line 335 rag_upsert_error, deleteChunksForPaths ~line 363 rag_delete_error, readChunkTexts ~line 568 rag_chunk_read_error) use bare console.log(JSON.stringify({...})) with no level field — invisible to Sentry. Two more in src/review/rag-index.ts (rag_index_repo_error ~line 318, rag_reindex_paths_error ~line 381) have the same problem. The sibling retrieveContextWithMetrics catch in the same rag.ts file was already fixed to console.error(JSON.stringify({level:"error",...})) with a comment noting the prior invisible-to-Sentry bug — that fix was never extended to the other call sites in the same module.
None of these paths increment a Prometheus counter either: gittensory_qdrant_errors_total only fires inside the Qdrant adapter itself, and embedTexts returns null before ever reaching a counted call — so an embedding-provider outage is invisible to GittensoryQdrantErrorRateHigh entirely.
Requirements
- Change the six cited call sites to
console.error with an explicit level: "error" field, mirroring the already-fixed sibling in the same file.
- Add a Prometheus counter (e.g.
gittensory_rag_pipeline_errors_total{op="embed|upsert|delete|chunk_read|index|reindex"}) distinct from gittensory_qdrant_errors_total, so an embedding-provider outage is alertable independent of the vector store's own health.
Acceptance criteria
- All six error paths reach Sentry the same way the already-fixed sibling does.
- A new counter exists and increments on each of these failure classes; tests cover it.
Parent: #1667
Context
src/selfhost/sentry.tsdocuments this codebase's console-forwarding convention:console.erroris forwarded to Sentry by default;console.logneeds an explicitlevel:"error"/"fatal"field to be forwarded at all.Four catch blocks in
src/review/rag.ts(embedTexts~line 303rag_embed_error,upsertChunks~line 335rag_upsert_error,deleteChunksForPaths~line 363rag_delete_error,readChunkTexts~line 568rag_chunk_read_error) use bareconsole.log(JSON.stringify({...}))with nolevelfield — invisible to Sentry. Two more insrc/review/rag-index.ts(rag_index_repo_error~line 318,rag_reindex_paths_error~line 381) have the same problem. The siblingretrieveContextWithMetricscatch in the samerag.tsfile was already fixed toconsole.error(JSON.stringify({level:"error",...}))with a comment noting the prior invisible-to-Sentry bug — that fix was never extended to the other call sites in the same module.None of these paths increment a Prometheus counter either:
gittensory_qdrant_errors_totalonly fires inside the Qdrant adapter itself, andembedTextsreturnsnullbefore ever reaching a counted call — so an embedding-provider outage is invisible toGittensoryQdrantErrorRateHighentirely.Requirements
console.errorwith an explicitlevel: "error"field, mirroring the already-fixed sibling in the same file.gittensory_rag_pipeline_errors_total{op="embed|upsert|delete|chunk_read|index|reindex"}) distinct fromgittensory_qdrant_errors_total, so an embedding-provider outage is alertable independent of the vector store's own health.Acceptance criteria
Parent: #1667