README: what Vigil is, developing, using, deploying

cd071af · gmorell · 2026-12-02 04:36

1 files +114 -13

Files changed

modified README.md
+114 −13
@@ -1,20 +1,121 @@
1 1 # Vigil
2 2
3 −To start your Phoenix server:
3 +A self-hosted error tracker that speaks Sentry's wire protocol. Point any
4 +Sentry SDK, or `sentry-cli`, at it and it works. It covers the same ground as
5 +GlitchTip, plus the parts GlitchTip drops, on Phoenix LiveView with Oban for
6 +everything that runs in the background, and Postgres as the only store.
4 7
5 −* Run `mix setup` to install and setup dependencies
6 −* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
8 +Source: `ssh://gabe@gg.neiam.co:22222/neiam/vigil.git` (branch `master`).
7 9
8 −Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
10 +## What it does
9 11
10 −Ready to run in production? See [docs/deploy.md](docs/deploy.md): the image,
11 −the release commands (`bin/migrate`, `bin/invite`, `bin/token`, ...) and
12 −every environment variable.
12 +- **Errors**: events from any Sentry SDK (envelopes, `store`, CSP reports,
13 + minidumps), grouped by 2019 Sentry's grouping strategies, with GlitchTip's
14 + as an option. You get issues with search, triage, assignment, comments,
15 + sharing, and resolving in the current or next release.
16 +- **Alerts**: "N events in M minutes", new issues, regressions, cron
17 + monitors failing, and uptime changes. They go by email, or to Slack-style,
18 + Discord, Google Chat, ntfy, Teams or Zulip webhooks, with retries and a
19 + delivery log.
20 +- **Releases and sourcemaps**: `sentry-cli releases`, `deploys` and
21 + `sourcemaps upload --wait`. Minified JavaScript is symbolicated by a Rust
22 + NIF.
23 +- **Native and mobile**: `sentry-cli debug-files upload` (ELF, Mach-O,
24 + PE/PDB). Native frames are symbolicated, ProGuard mappings applied to JVM
25 + frames, and minidumps turned into events.
26 +- **Performance**: transactions (sentry-elixir via OpenTelemetry) and
27 + streamed spans (sentry-python 3), shown as throughput, latency
28 + percentiles, error rates and trace waterfalls.
29 +- **Cron monitors**: check-ins from SDKs, sentry-elixir's Oban
30 + integration, or `sentry-cli monitors run`. Missed runs and timeouts open
31 + incidents.
32 +- **Uptime**: HTTP, TCP, TLS-expiry and heartbeat monitors, plus public or
33 + private status pages.
34 +- **Logs**: structured logs from both SDKs, with search, filters and a
35 + live tail.
36 +- **Release health**: crash-free sessions and users, and adoption.
37 +- **Organizations**: teams, roles and invites; membership can come from
38 + OIDC or LDAP groups (NEIAM). There are API tokens and a Sentry-shaped
39 + `/api/0` for project, key and issue management.
13 40
14 −## Learn more
41 +ROADMAP.md is the design document: the wire contract, the architecture,
42 +and what each slice built, as built.
15 43
16 −* Official website: https://www.phoenixframework.org/
17 −* Guides: https://phoenix.hexdocs.pm/overview.html
18 −* Docs: https://phoenix.hexdocs.pm
19 −* Forum: https://elixirforum.com/c/phoenix-forum
20 −* Source: https://github.com/phoenixframework/phoenix
44 +## Develop
45 +
46 +Postgres runs from `compose.yml` on host port 5437. You need Elixir 1.20+,
47 +and a Rust toolchain for the NIFs in `native/`, which Rustler builds from
48 +source.
49 +
50 +```sh
51 +podman compose up -d # Postgres 17
52 +mix setup # deps, database, assets
53 +mix phx.server # http://localhost:4000
54 +```
55 +
56 +Registration is invite-only. Make the first account's invite with
57 +`mix vigil.invite`, then create an organization and a project in the UI.
58 +To see events arrive without wiring up an app:
59 +
60 +```sh
61 +mix vigil.test ORG PROJECT # an error and a message
62 +mix vigil.test ORG PROJECT --kind transaction -n 50 # traces for Performance
63 +mix vigil.test ORG PROJECT --http # through the HTTP edge
64 +```
65 +
66 +`mix precommit` runs the compiler with warnings as errors, the formatter
67 +and the tests. Tests that drive the real SDKs and CLIs (sentry-python,
68 +sentry-elixir, sentry-cli, `vgl`) skip themselves when those aren't
69 +present. Point them at checkouts with `SENTRY_PYTHON_PATH`,
70 +`SENTRY_ELIXIR_PATH` and `SENTRY_CLI`.
71 +
72 +## Use it
73 +
74 +Create a project and copy its DSN. Then configure the SDK as you would for
75 +Sentry:
76 +
77 +```elixir
78 +config :sentry, dsn: "https://<key>@vigil.example.com/<project>"
79 +```
80 +
81 +```python
82 +sentry_sdk.init(dsn="https://<key>@vigil.example.com/<project>")
83 +```
84 +
85 +For `sentry-cli`, make a token under **Settings → API tokens** and set
86 +`SENTRY_URL`, `SENTRY_AUTH_TOKEN`, `SENTRY_ORG` and `SENTRY_PROJECT`.
87 +
88 +### The `vgl` CLI
89 +
90 +`cli/` is a command-line client for the same API: projects, keys and DSNs,
91 +issues, releases, monitors and uptime. It's built like gitgud's `gg` and
92 +packaged as .deb and .rpm by CI.
93 +
94 +```sh
95 +cd cli && cargo build --release
96 +vgl login --url https://vigil.example.com
97 +vgl projects create web --team backend
98 +vgl dsn
99 +```
100 +
101 +See cli/README.md.
102 +
103 +## Deploy
104 +
105 +One OCI image: `podman build --format docker -t vigil .`, or `docker build`.
106 +It needs Postgres and nothing else. [docs/deploy.md](docs/deploy.md)
107 +covers the release commands (`bin/migrate`, `bin/invite`, `bin/token`),
108 +health and metrics endpoints, storage (local or S3), mail, clustering,
109 +retention, and every environment variable.
110 +
111 +CI (`.forgejo/workflows/`) runs on pushes to `master`:
112 +- checks: cargo fmt, clippy and tests, then `mix precommit`;
113 +- an osv-scanner audit;
114 +- the image build;
115 +- the `vgl` packages.
116 +
117 +## License
118 +
119 +AGPL-3.0 (LICENSE). Vigil ports code from GlitchTip (MIT), the 2019 BSD
120 +release of Sentry, sentry-cli (BSD-3) and others. NOTICE.md lists them with
121 +their licenses.

Parents: c7f8198