feat(ocr): increment ocr_skipped_pages_total on per-page engine failure
Bumps the counter in both /ocr/stream except blocks (standard and guided generators) so the existing skipped_pages local variable now also flows into Prometheus. Refs #652 (AC3b) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -219,6 +219,7 @@ async def run_ocr_stream(request: OcrRequest):
|
||||
except Exception:
|
||||
logger.exception("Guided OCR failed on page %d", page_idx)
|
||||
skipped_pages += 1
|
||||
metrics.ocr_skipped_pages_total.inc()
|
||||
yield json.dumps({
|
||||
"type": "error",
|
||||
"pageNumber": page_idx,
|
||||
@@ -274,6 +275,7 @@ async def run_ocr_stream(request: OcrRequest):
|
||||
except Exception:
|
||||
logger.exception("OCR failed on page %d", page_idx)
|
||||
skipped_pages += 1
|
||||
metrics.ocr_skipped_pages_total.inc()
|
||||
yield json.dumps({
|
||||
"type": "error",
|
||||
"pageNumber": page_idx,
|
||||
|
||||
Reference in New Issue
Block a user