Get started

Source health

Source

Every source Vitna reads, and whether it is still answering.

text
GET /api/v1/sources/health
bash
curl https://vitna.ai/api/v1/sources/health

Response

json
{
  "sources": [ { "source": "...", "provider": "...", "enabled": true, "stale": false, "consecutiveFailures": 0, "lastFetchAt": "...", "lastOkAt": "...", "cadenceMinutes": 60 } ],
  "meta": { "generatedAt": "...", "source": "database", "count": 21, "staleCount": 0, "failingCount": 0, "ok": true }
}

meta.ok is the one-glance answer: true when nothing enabled is stale and nothing enabled has failed three times running.

meta fieldMeaning
staleCountEnabled sources past their cadence
failingCountEnabled sources at three or more consecutive failures
okBoth counts are zero

A source that has been switched off is still listed, with enabled: false and the failure count it stopped at, and counts toward neither. It is no longer read, so that count can never move again, and /witness shows the source as held rather than failing.

Public on purpose

A red source is part of the record.

A tape that silently stopped updating because a pricing page moved looks exactly like a market that stopped moving. Publishing source health is what lets a reader tell those apart without asking anyone.

503 rather than a green light

If the record cannot be read, this answers 503 record_unavailable.

It never falls back to the committed snapshot. A health endpoint reporting green from a file on disk would be the one lie this whole system exists to prevent, and it would be reporting on sources it had not looked at.

Errors

StatusCodeCause
503record_unavailableThe record is not reachable from this instance

Caching

no-store. A cached green is a claim about the past.