Merge packaging; deploy docs for health, metrics, self-reporting and retention

27ce267 · gmorell · 2026-12-02 03:50

2 files +37 -1

Files changed

modified docs/deploy.md
+37 −1
@@ -36,7 +36,21 @@ there.
36 36
37 37 The image's `HEALTHCHECK` fetches `GET /_health/` on `127.0.0.1:$PORT`, with
38 38 `Host: localhost` so the HTTPS redirect leaves it alone. Point liveness
39 −probes there.
39 +probes there: it answers `ok` without touching the database.
40 +
41 +`GET /api/0/internal/health/` is the readiness check, in Sentry's shape
42 +(`{"problems": [...], "healthy": {...}}`): the database answers, Oban is
43 +running, and the ingest buffer is under 50,000 waiting items. It answers
44 +503, listing the problems, otherwise.
45 +
46 +`GET /metrics` is Prometheus text: request, query, ingest and Oban
47 +timings, backlog gauges and VM figures. It is off unless one of the
48 +variables below turns it on.
49 +
50 +| Variable | Default | |
51 +|---|---|---|
52 +| `METRICS_TOKEN` | unset | Serves `/metrics` to `Authorization: Bearer <token>` |
53 +| `METRICS_PUBLIC` | `false` | `true` serves `/metrics` to anyone (scrape over a private network only) |
40 54
41 55 ## Environment
42 56
@@ -113,6 +127,28 @@ replicas a key can take up to N times its limit.
113 127
114 128 With `POD_IP` set, the Erlang distribution listens on port 9100 only.
115 129
130 +### Self-reporting
131 +
132 +Vigil can report its own errors and Oban cron jobs (as cron monitors)
133 +through sentry-elixir, to a project on itself or on another Vigil.
134 +Errors about the ingest path itself are dropped, so a broken ingest
135 +can't report into a loop.
136 +
137 +| Variable | Default | |
138 +|---|---|---|
139 +| `VIGIL_SELF_DSN` | unset | The project's DSN. Unset: nothing is sent |
140 +| `VIGIL_SELF_ENVIRONMENT` | `production` | The environment those events carry |
141 +
142 +### Retention
143 +
144 +Partitioned data is kept for set periods (`config :vigil, Vigil.Partitions`):
145 +events 90 days, logs 30, spans 14, uptime checks 30, session counts 400.
146 +Releases are kept 365 days after their last issue (`config :vigil,
147 +Vigil.Retention, release_days:`). An organization can keep less, under
148 +Settings → General. A daily job (03:53 UTC) applies those limits. It also
149 +removes stale issues, releases and orphaned artifact bundles, and, a day
150 +after deletion, deleted projects and organizations with their files.
151 +
116 152 ### Sign in with NEIAM (OIDC)
117 153
118 154 Off unless `OIDC_ENABLED=true`. `OIDC_LOGIN_MODE`, `PUBLIC_URL`,

Parents: deb08b9