feat(admin): monitoring des microservices + heartbeat du worker LLM #14
Closed
kyuno
wants to merge 1 commit from
feat/admin-monitoring into feat/admin-metrics
pull from: feat/admin-monitoring
merge into: kyuno:feat/admin-metrics
kyuno:main
kyuno:feat/temperature-metadata
kyuno:feat/merge-admin-into-web
kyuno:fix/mocha-db-suites-first-run
kyuno:feat/admin-tech-steps
kyuno:feat/off-catalog-ingredients
kyuno:feat/cooking-session-ui
kyuno:feat/admin-metrics
kyuno:feat/admin-web-scaffold
kyuno:feat/admin-auth
kyuno:feat/cooking-session-api
kyuno:feat/cooking-optimizer-engine
kyuno:feat/tech-step-correction-merged-editor
kyuno:fix/tech-step-correction-metadata-discoverability
kyuno:feat/tech-step-correction-metadata
kyuno:feat/tech-step-metadata
kyuno:feat/tech-step-intent-service
kyuno:feat/shopping-list
kyuno:feat/fr-ingredient-unit-matching
kyuno:feat/sources-infinite-scroll
kyuno:fix/750g-browse-empty-query
kyuno:feat/marmiton-recipe-source
kyuno:feat/tech-step-detection-reliability
kyuno:experiment/llm-tech-step-poc
kyuno:feat/nlp-tech-step-detection
kyuno:chore/biome-style-rules
kyuno:feat/unify-source-detail-view
kyuno:fix/isolate-test-database
kyuno:fix/json-ld-not-a-browsable-source
kyuno:feat/browse-sources-backend
kyuno:feat/browse-sources-ui
kyuno:feat/import-recipe-review
kyuno:feat/plan-import-flow
kyuno:feat/highlight-tech-steps
kyuno:fix/runtime-seed-source-sync
kyuno:feat/english-matching
kyuno:feat/jsonld-source-adapter
kyuno:feat/recipe-step-translation
kyuno:feat/themealdb-source-icon
kyuno:feat/house-source-preferences
kyuno:feat/tech-steps-catalog
kyuno:feat/recipe-source-adapter
kyuno:feat/recipe-source-linking
kyuno:feat/ingredient-unit-catalog
kyuno:feat/ingredient-reproducible-flag
kyuno:refactor/catalog-camel-case-uids
kyuno:experiment/cucumber-cypress
kyuno:feat/recipe-catalog-v2
kyuno:feat/planning-page-design
kyuno:feat/settings-household-account
kyuno:feat/user-preferences-sidebar-nav
1 commit
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 57cb2b7b3d |
feat(admin): monitoring des microservices + heartbeat du worker LLM
PR 4 du chantier admin. Board de sante temps reel des dependances.
- POST /internal/tech-steps/heartbeat (requireInternalWorker) ->
recordWorkerHeartbeat : upsert WorkerHeartbeat (cle fixe
"tech-step-llm-worker"), lastRunAt/lastResult pour un ping "job".
Schema workerHeartbeatSchema dans packages/shared.
- services/tech-step-llm-worker : api-client.postHeartbeat (best-effort,
ne throw jamais) appele au boot (index.ts), a chaque tick et apres
chaque job (scheduler.ts, avec job/ok/counts).
- admin-monitoring.service.ts + GET /admin/monitoring (requireAdmin) :
sonde active bornee (~2 s) de Postgres (SELECT 1), l'API (uptime/RSS),
tech-step-intent-service (/health), et le worker via son heartbeat.
Statut up/degraded/down/unknown ; une sonde down ne casse ni les autres
ni l'endpoint. Seuils worker : > 8 j degraded, > 21 j down.
- MonitoringView / ServiceHealthView dans packages/shared.
- Front : MonitoringPage (grille de cartes coloree par statut, re-poll
15 s), logique pure monitoring.ts, i18n admin.monitoring.*,
AdminApiClient.getMonitoring.
- Tests : Mocha admin-monitoring.test.ts (heartbeat 401/400/upsert
job+boot ; GET /admin/monitoring 401, board 4 cibles, worker unknown
sans heartbeat puis up apres) ; Cypress monitoring.cy.ts (2 verts).
Worker mocha : 6/6 toujours verts.
- specs/backend-architecture.md : section monitoring. .gitignore :
apps/admin-web/cypress/{screenshots,videos,downloads}.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|