Seam: wire OSRM reachability probe into /healthz and /metrics #89
Labels
No labels
in-progress
in-review
ready-for-agent
seam-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
patrick/Polaris#89
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
PH6.1 (#42) ships
polaris.core.health.check_osrm()— a standalone OSRM reachability probe (backend/src/polaris/core/health.py) — per its acceptance criterion "OSRM down →/healthzdegraded, plan still produced,W_TRAVEL_FALLBACKfinding".That ticket's owned paths (
docs/12-implementation-plan.mdrow PH6.1) are onlyengine/travel/osrm.pyandcore/health.py. The actual/healthzroute (backend/src/polaris/api/routers/platform/health.py) and/metrics(backend/src/polaris/api/metrics.py) are outside those owned paths — both were created by PH0.2 and are not listed as PH6.1's to touch — so PH6.1 could not wire the probe into either endpoint without violating the "don't edit files you haven't edited before" rule inCLAUDE.md.api/routers/platform/health.py's own docstring already anticipated this: "Keycloak JWKS and OSRM reachability checks ... are added by the tickets that introduce those dependencies (PH0.4, PH6.1)" — but itsCheckStatustoday is a two-stateLiteral["green", "red"], anddocs/07-architecture.mdcalls for OSRM-down to read as degraded, not failed ("osrm reachable → degraded not failed"), alongside db/Keycloak staying green. That needs a third state.What this seam needs to do
HealthResponse'sCheckStatus(or add a sibling type) to a three-state shape soosrm: reddoesn't forceoverall: redwhen db/Keycloak are fine —osrmshould pushoverallto a newyellow/degradedvalue instead.polaris.core.health.check_osrm()fromGET /healthz, addchecks["osrm"]./metrics(apolaris_osrm_reachablegauge, matching the style of the existingpolaris_task_queue_depthetc. inapi/metrics.py).keycloakcheck — worth doing both in the same PR since they touch the same two files and the sameCheckStatuswidening.Acceptance criteria
CheckStatus(or equivalent) has a degraded/yellow state distinct from redGET /healthzreportschecks.osrmusingpolaris.core.health.check_osrm(), andoverallisyellow/degraded(notred) when only OSRM is down/metricsexposes OSRM reachability/healthz//metricstests still pass; new tests cover the degraded-not-failed caseRelated
Blocks nothing further from #42 shipping (the provider itself is complete and independently useful — see #42's PR); this closes the remaining gap in its third acceptance criterion.