Roadmap
Vigil is a Sentry-compatible error tracker in the GlitchTip mould: the
Sentry SDKs and sentry-cli talk to it unchanged. It is a Phoenix app with
Oban for every background and periodic job, LiveView for every
screen, UUIDv7 keys everywhere (Vigil.Schema), and Rust NIFs for
format work, in the manner of gitgud’s native/ crates.
The plan is grouped into slices. Each slice ships something usable and ends
with mix precommit green. Sizes are estimates.
References and licensing
The reference code lives in ~/Development/local/sentry_oss_2019/:
| Repo | License | Used for |
|---|---|---|
glitchtip-backend |
MIT | The primary server reference: ingest, data model, alerts, uptime, maintenance |
sentry (2019-11-06, before the switch to BSL) |
BSD-3-Clause | Grouping strategies, event normalisation, culprit and title rules |
sentry-python, sentry-elixir |
MIT | What clients send and how they react to responses |
sentry-cli |
BSD-3-Clause | The release, chunk-upload and assemble API |
sentry-docs, snuba, onpremise |
Apache-2.0 | Protocol docs |
- Logic ported from any of these keeps its copyright notice in
NOTICE.md. - Never consult Sentry server code from after 2019-11, which is BSL.
Wire contract
These rules are not negotiable. The conformance tests in slice 1 pin them down.
Endpoints and auth
POST /api/:project_id/envelope/is the only endpoint current SDKs use./store/(legacy SDKs),/security/(CSPreport-uri) and/minidump/are secondary. Routes work with and without the trailing slash.- The key is read from, in order:
- the
sentry_keyquery parameter (alsoglitchtip_key); - the
X-Sentry-Authheader; - the
Authorizationheader; - the envelope header
dsn, which GlitchTip ignores but tunnels rely on.
- the
sentry_version5 (Elixir) and 7 (Python) are both accepted.sentry_timestampandsentry_secretare optional.- The key, the project, the organisation, and whether each is active and not deleted are checked before the body is read.
Request bodies
Content-Typeis ignored. Elixir sends none; Python sendsapplication/x-sentry-envelope.Content-Encodingmay begzipordeflate(zlib-wrapped, or raw deflate as a fallback), both via:zlib;zstdvia OTP 28’s:zstd; orbrvia a NIF. br is Python’s default.- Bodies are capped twice: raw at 20 MiB, decompressed at 100 MiB per envelope and 1 MiB per event item. Decompression stops at the cap rather than inflating the whole body and checking afterwards.
Envelope parsing
- An item is length-prefixed when its header has
length; otherwise it runs to the next newline. Elixir’slogandtrace_metricitems have nolength. - Unknown item types are skipped and parsing continues. GlitchTip stops at the first one; Vigil must not.
- Payloads tolerate
nullanywhere.exception,breadcrumbsandthreadsmay be bare arrays or{"values": […]}.messagemay be a string or an object. Timestamps may be ISO strings with or withoutZ, or unix ints or floats.
Responses
- Always
200with a JSON object:{"id": "<envelope event_id>"}, or{}when there is none.- sentry-elixir treats anything other than a 200 with a JSON object as a failure and retries it five times.
send_result: :syncreturns thatidto the caller.
429carriesRetry-After: <int>andX-Sentry-Rate-Limits: <int>:<categories>:<scope>[:<reason>]. Use integers: Python silently drops float values.413for oversize bodies; both SDKs drop the envelope and don’t retry.403 {"detail": …}for a bad key, with a short negative cache so that sentry-elixir’s retries don’t each hit the database.
CORS
*origins.- Allowed headers include
x-sentry-auth,sentry-trace,baggageandcontent-type. - Exposed headers:
Retry-After,X-Sentry-Rate-Limits,X-Sentry-Error.
Item types
Every item type the SDKs send gets a 200, whether it is stored or dropped:
| Item type | Handling |
|---|---|
event |
Stored |
transaction (Elixir) |
Stored |
span v2 (Python 3.x) |
Stored |
check_in |
Stored |
log |
Stored |
client_report |
Stored as outcome counts |
session, sessions |
Stored |
user_report, feedback |
Stored |
attachment |
Stored |
trace_metric, profile_chunk, replay_* |
Accepted and dropped until a slice takes them |
Architecture
SDK ──► Vigil.Ingest.Plug (in the Endpoint, ahead of Plug.Parsers and the
│ session; ingest never touches cookies)
├─ auth: ETS cache of project keys, invalidated over PubSub
├─ rate limit: ETS counters per key and org, with outcome headers
├─ decode: zlib / zstd / brotli NIF, with output caps
├─ frame: Vigil.Ingest.Envelope (pure Elixir; split items, skip unknown)
└─ buffer: INSERT into ingest_items, then Oban.insert of a unique
Drain job. Respond 200 {"id"}.
│
Oban queue :ingest ▼
Vigil.Ingest.Drain: claims up to 100 rows (FOR UPDATE SKIP LOCKED) and
dispatches each by item type to a processor:
Events.Process normalise ─► symbolicate ─► title/culprit ─► group
─► upsert issue ─► insert event ─► tags/stats
─► mark for alerts ─► PubSub
Performance.Process, Crons.Process, Logs.Process, Sessions.Process,
Outcomes.Process, Feedback.Process
Why a buffer table instead of payloads in Oban args. Envelope items can
be megabytes. In oban_jobs.args they would bloat the jobs table and its
pruner, and each event would cost its own job. A plain ingest_items table
drained in batches behaves like GlitchTip’s 100-item, 2-second batches.
Oban still owns scheduling, retries, concurrency and telemetry. A Drain job
is unique per project within a 1-second window, so a burst of envelopes
queues one drain, not one per item.
Oban queues:
ingest: the drains.processing: symbolication and assemble.notify: email and webhooks.checks: uptime probes.maintenance: partitions and retention.
Oban cron jobs:
| Job | Schedule |
|---|---|
| Alert evaluation | every minute |
| Cron monitors: missed and timed-out check-ins | every minute |
| Uptime reconciler: make sure each monitor has its next job scheduled | every minute |
| Partition maintenance | daily |
| Retention sweep | daily |
| Stale-blob cleanup | daily |
Oban’s cron can’t run more often than once a minute, so uptime checks are
self-rescheduling jobs: each check inserts its successor at now + interval, unique per monitor. GlitchTip ticks a Valkey counter every
second instead.
Storage. Postgres only: no Valkey and no ClickHouse.
- High-volume tables are range-partitioned by UUIDv7 id per day
(
issue_events,log_events,spans,monitor_checks,outcomes). - Stats tables are partitioned weekly by
date. Vigil.Partitionscreates partitions ahead of time and drops whole partitions for retention. There are no DEFAULT partitions, so a missing partition fails loudly instead of silently filling one.
Live updates. Processors broadcast on PubSub topics
(project:<id>:issues, issue:<id>, logs:<project>). Issue lists and
the log tail update in place. libcluster is added when it runs on more
than one pod, as cartosnap does.
NIF crates (native/, in gitgud’s style)
Each crate is a cdylib on rustler with a committed Cargo.lock and a thin
use Rustler module. They are built from source with a pinned rustup
toolchain in the Dockerfile and CI, and pass clippy -D warnings.
Cargo.toml comments justify feature choices, and no crate may add system
libraries to the images.
| Crate | What | Slice |
|---|---|---|
vigil_codec |
Brotli decode with an output cap, on the brotli crate. ex_brotli (MIT) was considered, but its decompress/1 reads to the end with no limit (a decompression bomb at the ingest edge) and fetches precompiled binaries by default, so the crate lives here |
1 |
vigil_ua |
User-Agent to browser, OS and device contexts, on the uaparser crate with the uap-core regexes compiled in |
2 |
vigil_sourcemap |
JS symbolication on the sourcemap crate (debug ids, index maps, sourcesContent context lines), plus zip and manifest reading for artifact bundles |
5 |
vigil_symbolic |
Debug files, SymCaches and native symbolication on symbolic 12, Proguard deobfuscation on proguard, and minidump unwinding on rust-minidump |
12 |
Slices
0. Foundations: orgs, projects, keys, tokens · medium · done
- Add Oban (Postgres engine, Pruner, Lifeline, Cron) and a
NOTICE.md. - Organizations: slug unique, reserved words blocked;
accepting_events;scrub_ip. - Org members: user, org, role. Roles are member, admin, manager and owner, each with a scope set as in GlitchTip.
- Org invites: addressed and hashed, as registration invites already are. For someone without an account an org invite doubles as a registration invite, so it reuses
Vigil.Accounts.Invite’s flow and NEIAMlink_pending. - Teams: members and projects. Teams control which projects a member can see; admins and owners see everything.
- Projects: slug unique per org, platform,
first_event_at,scrub_ip. - Project keys: public key UUID, active flag, rate limit
{count, window}that is actually enforced, and the DSN builder. - API tokens: per user, labelled, scopes, stored as a SHA-256 hash and shown once. A
Bearerplug computes effective scopes as token scopes ∩ the user’s role scopes in the target org (GlitchTip ignores the role). - LiveView: org switcher and create; org settings (members, invites, teams); project create (platform picker and a DSN snippet per SDK); project settings (keys); account → API tokens.
Vigil.Partitionsand the maintenance cron job exist here, so later slices only declare their tables.- Org membership from identity-provider groups, configurable per org:
- Rules: an
org_group_rulestable of(org, provider or any, group, role, teams[]). Owners edit it in org settings. It can also be declared in config and applied at boot, e.g. groupneiam→ member andneiam-admins→ admin for orgneiam, so a fresh install comes up already wired. - When it runs:
NeiamAuthAdapter.apply_groups/2, which neiam_auth calls on every login for providers withGROUPS_CLAIM, just after it has updated the identity’s stored groups. - How it computes: the sync reads every identity the user has (
NeiamAuth.identities/1: provider and groups), not the callback’s bare group list, so rules can be scoped per provider. A user’s role in an org is the highest role among the rules that match. - Managed vs manual memberships: each membership records
source: manual | group. Sync creates, promotes and demotes onlygroupmemberships. Manual ones are left alone, unless the org opts to let group rules raise a manual member’s role. - Losing a group: an org setting picks remove (the default), demote to member, or keep.
- The last owner is never removed or demoted. Every change is written to an audit log.
- Lag: changes apply at the user’s next login. There is no LDAP or SCIM polling. “Re-sync” in the org settings re-applies the rules to the groups stored from each member’s last login.
- Account creation stays with neiam_auth’s
OIDC_PROVISION_GROUPS(decided 2026-12-01), an env list per provider, set to the same groups as the rules. The rules decide org membership only. If that ever needs to be configurable in the app, the change is an optionalprovision?(claims)adapter callback in neiam_auth, answered fromorg_group_rules. - A first SSO login that matches no rule follows the usual invite-only path.
- Rules: an
- Exit: a user can create an org and project, copy a DSN, and mint a token. A NEIAM login in group
neiam-adminslands as admin of orgneiam.
1. Ingest edge · large · done
Vigil.Ingest.Plugcovering everything under Wire contract: auth with a negative cache, decoders with caps, envelope framing, CORS, rate limits with outcome headers, the buffer and the Drain job./store/,/security/and/minidump/route into the same pipeline./minidump/stores the attachment for slice 12.- Items for later slices are kept in
ingest_itemswith adeferredstate, not discarded, so those slices can process the backlog when they land. client_reportbecomes outcome counts (outcomes: org, project, category, reason, hour, quantity), shown later as “dropped by SDK”.- Conformance suite:
- Fixture envelopes captured from real sentry-python 3.x and sentry-elixir 14.x runs.
- Hand-written edge cases: no
length, unknown types, nulls, bare arrays, binary attachments, br/gzip/zstd bodies, bombs, auth in each of the four places. - Tests on the status code, the body and the headers.
- An optional CI job runs the real sentry-python and sentry-elixir against a test server.
- Exit: both SDKs report success, and nothing is retried or lost.
- As built:
- Real sentry-python 3.x and sentry-elixir 14.x run against a live test server (
VigilWeb.SdkConformanceTest). sentry-elixir gets back its event ids withresult: :sync. - DSNs carry
projects.dsn_id, an integer. sentry-python (int(path.pop())) and sentry-elixir (Integer.parse/1) refuse anything else in that position, so this is the one id that isn’t a UUIDv7; the primary key still is. - The drain claims a batch in one statement, then processes each item in its own transaction, so one bad item can’t roll back the rest.
- Real sentry-python 3.x and sentry-elixir 14.x run against a live test server (
2. Events into issues · large · done
- Normalisation:
- Tolerant per field, as GlitchTip: a bad interface becomes
nilplus an entry inerrors[], never a rejection. - Bare arrays and
valuesare unified, andlogentryis formatted. - Request headers become a sorted list, and cookies are scrubbed.
- Client IPs are set and anonymised per project.
\u0000is stripped.
- Tolerant per field, as GlitchTip: a bad interface becomes
- Threads: an exception without a stacktrace borrows one from
threads. - Contexts: browser, OS and device are filled from the User-Agent (
vigil_ua). - Title, culprit and metadata: ported from 2019 Sentry and GlitchTip’s
sentry/subset.culpritis persisted, which GlitchTip forgets to do. - Grouping: several strategies side by side.
- Each strategy is a
Vigil.Grouping.Configmodule with an id:newstyle:2019-10-29, the default, ported from 2019 Sentry (BSD): stacktrace components with in-app frames first, exception type, message fallback;legacy:2019-03-12, also from 2019 Sentry;glitchtip:compat, GlitchTip’smd5(title + culprit + type).
- All of them honour
fingerprintand{{ default }}. - Each project picks a primary strategy, as in 2019 Sentry’s
sentry:grouping_config. Each event records the strategy it was grouped with. - Every event yields several hashes: 2019 Sentry already makes one per variant (in-app, system), and an event joins whichever existing issue matches any of them.
issue_hashesrows are(project, config, hash). Switching a project’s strategy starts a transition window, during which events are hashed under both the old and new strategies. Existing issues keep matching through the old hashes and pick up new ones, so nothing splits.- A preview shows how another strategy would group the last N events of a project, as a dry run without writing issues, so a switch can be judged first.
- Two live parallel issue sets for the same events are possible on this schema but double the issue, count and tag storage. Left out unless needed.
- Each strategy is a
- Issues:
- Short id from a per-project counter upsert:
PROJ-1A. - Status: unresolved, resolved, resolved-in-release, ignored.
- Regression: a resolved issue reopens on a new event, or on an event from a different release when it was resolved in a release. Its alert dedupe resets.
- Counts and first/last seen are updated in a single bulk statement per drain batch.
- Releases and environments are created automatically.
- Short id from a per-project counter upsert:
- Events: partitioned by day; the
dataJSON is trimmed to the interfaces;event_idis unique per project, which dedupes retries. - Tags and stats:
tag_keysandtag_valuesdictionaries.issue_tagscounts per day.- Hourly
issue_countsandproject_counts.
- Search: a tsvector over title, culprit, transaction and frame filenames, plus a trigram index on title.
- User feedback:
user_reportandfeedbackitems are linked to the issue byevent_id. - Exit: errors from both SDKs group sensibly and survive regression and resolve cycles.
- As built:
- Grouping is a port of 2019 Sentry’s
newstyle:2019-10-29andlegacy:2019-03-12, which matches all 200 of Sentry’s own grouping snapshot fixtures (100 inputs × 2 configs, whole variant trees, not just hashes), plusglitchtip:compat. - Stack-trace enhancement rules are Sentry’s own rule files, parsed at compile time. Projects can add rule text of their own (
Vigil.Groupingopts). - Sentry’s Rust glob matcher was rebuilt from its tests; no fixture exercises the bracket cases.
- The user-agent NIF is
woothee, with no rules file to ship. - Real sentry-python and sentry-elixir events go all the way into issues in
VigilWeb.SdkConformanceTest. mix vigil.test ORG PROJECTsends test events.
- Grouping is a port of 2019 Sentry’s
3. Issue UI · large · done
- Project issue list:
- Stream-backed with live inserts.
- Filters for status, level, environment, release, assignee and time range.
- Free-text and
key:valuetag search. - A sort selector.
- A sparkline per row from the hourly counts.
- Bulk resolve, ignore, delete and assign.
- Issue detail:
- A header with counts, first and last seen, releases, and a tag facet sidebar from
issue_tags. - An event pager (newest, oldest, prev, next).
- Stacktrace with in-app collapsing, frame vars and source context, and a raw/symbolicated toggle.
- Chained exceptions, breadcrumbs, request, contexts, user, extra, SDK, and a JSON view.
- Comments, assignee, user feedback, and a public share toggle.
- A header with counts, first and last seen, releases, and a tag facet sidebar from
- Org dashboard: projects, recent issues across them, and an events-per-hour chart.
- Keyboard navigation (j/k, e/r/i).
- Exit: daily triage is possible without leaving Vigil.
- As built:
- Issue list filters live in the URL (
q,status,env,period,sort,page); search is Sentry style (is:,level:,env:,release:,assigned:me,key:valuetags, free text). Live updates are coalesced to one a second. - Issue detail has event navigation, stack traces with system frames folded and source context, and the full interfaces. The share page shows the exception and stack only (no request, user, breadcrumbs, contexts or frame vars).
- The org dashboard has an events-per-hour chart (with a table view), 24h counts per project, and the latest unresolved issues.
- Keyboard shortcuts on the list (j/k/o/x/r/i, /) and on the detail page (r/i/u, j/k events, c). Neither has been tried in a browser yet.
- Permissions: GlitchTip gives every role
event:admin, so deleting issues and moderating comments needproject:admin(admins and up) instead.
- Issue list filters live in the URL (
4. Alerts and notifications · medium · done
- Rules: per project, “N events in M minutes”, “new issue” and “regression”. Recipients are email, a generic webhook (Slack-compatible), Discord, ntfy, Teams, Google Chat and Zulip, with GlitchTip’s payload shapes.
- Evaluation:
- Processors record touched issues in an
alert_candidatestable (instead of a Valkey set). - A minutely Oban cron job evaluates the rules.
- Delivery is one Oban job per recipient. Unlike GlitchTip it retries with backoff, and failures are visible in the UI.
- Processors record touched issues in an
- Dedupe: once per issue per rule, until a regression. A “snooze for X” option re-notifies after time passes, which GlitchTip can’t.
- Who gets email: per-user project subscriptions with a subscribe-by-default setting; email goes through Swoosh.
- Exit: new and regressed issues reach email and a webhook exactly once.
- As built:
- Rules are frequency, new issue and regression, with an optional re-notify window; dedupe is per (rule, issue) and a regression clears it.
- Evaluation is a minutely Oban cron job over
alert_candidates, and delivery is an Oban job per recipient (5 attempts) with a visible delivery log. - Email goes to members who can see the project minus opt-outs. Webhook payloads are ported from GlitchTip (Slack-compatible, Discord, Google Chat, ntfy, Teams, Zulip), with “and N more” past 3 issues.
Vigil.Outboundrefuses private, loopback, link-local, CGNAT and reserved addresses, v4 and v6 (mapped, NAT64, 6to4), and hosts that don’t resolve; such deliveries fail without retrying. DNS rebinding is a known limitation.
5. Releases, sentry-cli and sourcemaps · large · done
The /api/0 API:
GET /api/0/returns user and token info.- Releases:
- Create under both the org and project paths. It must be idempotent, which GlitchTip’s org path isn’t: it returns a 500.
- Update, finalize and delete.
- Get, returning 404 when missing.
- List, with Link-header cursors.
versionandshortVersionare both emitted.dateReleasedstays null until finalize; GlitchTip sets it on create.
- Deploys and commits: deploys can be created and listed. The
commitsandrefssent in the release PUT are stored (GlitchTip drops them).GET /repos/returns[], andprevious-with-commitsreturns 404. - Chunk upload:
GETadvertisesartifact_bundles(and laterartifact_bundles_v2).POSTtakes multipartfile_gzipparts. It verifies each SHA-1, which GlitchTip doesn’t, and stores blobs per org rather than globally.
- Artifact-bundle assemble:
not_foundreturns the missing chunks.- Otherwise an Oban assemble job runs, with status tracked per
(org, checksum). - It returns
created, thenassembling, thenokorerror, so--waitworks. GlitchTip never returnsok.
- Bundles: extract the manifest and pair minified files with their maps by debug id or
Sourcemapheader, intoartifact_bundle_files. - JS symbolication with
vigil_sourcemap:- Match by debug id from
debug_meta.images, falling back to release and filename. raw_stacktraceis kept.- Handles
webpack:,app:and~/prefixes, and setsin_app.
- Match by debug id from
- File storage behind a small behaviour, with local disk and S3 (Req’s
aws_sigv4, as cartosnap does). - UI: releases list and detail (new, resolved and regressed issues, deploys, artifacts). Issues gain “resolve in next release”.
- Exit:
sentry-cli releases new/finalize/deploys,sourcemaps upload --waitand a minified-JS error together give a readable stacktrace. - As built:
- Release create is idempotent on both paths: 201 when new or newly linked, otherwise 208, as 2019 Sentry answers.
archive/restorearrive as an org-path POST withstatus. Commits and refs from PUT are kept indata. Lists use Sentry’s cursor Link headers. A token sees only releases of projects it can see. - Chunk upload advertises
release_files,artifact_bundlesandartifact_bundles_v2. sentry-cli 2.58 only chunks source maps at all whenrelease_filesis offered. With no project named it uses the release-boundreleases/{v}/assemble/, which assembles into the release’s projects. - Chunks are gzip-capped, SHA-1-checked and kept per org in
Vigil.Storage(local disk or S3). The assemble job checks the whole SHA-1, reads the bundle with thevigil_sourcemapNIF (capped while inflating; sentry-cli’sSYSBheader is handled) and extracts files with their debug ids. Anerroris reported once, so a re-upload retries. Blobs and statuses are dropped after a day. - Symbolication runs before grouping, so hashes, title and culprit use the mapped frames. It looks up by debug id, then release + dist + url (
~/,app:///,webpack://), then thesourcemapheader,sourceMappingURLor<url>.map.raw_stacktraceis kept, and it can never drop an event. - Regressions follow Sentry’s GroupResolution. Resolved in X: X or newer reopens it. Resolved in the next release: only newer than the latest reopens it. Events without a release don’t reopen. Release order is creation order, from UUIDv7 ids.
- The release page’s “regressed” list is approximate (“earlier issues seen in this release”), since no regression history is kept yet.
- Tested end to end with the real sentry-cli 2.58.2: releases, deploys, set-commits, and
sourcemaps upload --waitto a symbolicated event.
- Release create is idempotent on both paths: 201 when new or newly linked, otherwise 208, as 2019 Sentry answers.
6. Performance · large · done
- Storage:
- Elixir sends
transactionitems withspans[]; Python 3.x sendsspanv2 items (is_segmentmarks the root). - Both normalise into one
spanstable, partitioned daily, with trace id, span id, parent, segment, op, name, status, start, duration and attributes. - Segment spans roll up into
transaction_groupskeyed by(project, name, op, method). - Rollups keep count, error count, average duration and a 50-bucket histogram from which p50, p95 and p99 are computed, as in GlitchTip.
- Elixir sends
- UI:
- A transactions list with throughput, latency percentiles and error rate.
- A transaction detail page with a duration histogram and sample traces.
- A trace waterfall built from the spans.
- Errors and spans linked through
contexts.trace.trace_id.
- Later: N+1 query detection (repeated
dbspans under one parent), as GlitchTip’s MCP tools offer. - Exit: a Phoenix app with sentry-elixir tracing shows endpoints and waterfalls.
- As built:
- Ingest:
transactionitems (sentry-elixir: the transaction is the segment,spans[]its children) andspanv2 items (sentry-python 3.0 streams spans only) normalise intospans, partitioned daily with 14 days kept.- Each segment upserts its
transaction_groupsrow (name, op, method), adding to count, errors, duration total and a histogram bucket in one statement, plus its hour intransaction_counts. - Failure follows Sentry: any status but ok, cancelled, unknown or unset.
- Counts go in the hour the item arrived, so a skewed SDK clock can’t miss a partition.
- Errors carry
issue_events.trace_id, taken fromcontexts.trace, and a trace lists the errors raised in it. - Pages: the project’s transactions list (tpm, avg, p50/p95, error rate; sort and search in the URL; live), a transaction’s detail (lifetime stats, hourly throughput and duration histogram charts, recent and slowest samples), an org-level trace waterfall (spans from every visible project), and “View trace” on error events. The org dashboard’s chart is now the shared
VigilWeb.ChartComponents.bars/1. - Tested with the real sentry-elixir 14.1 through OpenTelemetry (it turns tracing off without
opentelemetry_exporterandopentelemetry_semantic_conventions) and the real sentry-python 3.0.2 (which also traces its own envelope POSTs ashttp.clientspans). mix vigil.test ORG PROJECT --kind transactionsends sample traced requests.- Not done: N+1 detection (“Later”). The trace page queries twice per visit, once for the static render and once on connect.
- Ingest:
7. Cron monitors · medium · done
This is new: GlitchTip throws check_in items away.
- Monitors:
- Upserted from
monitor_config(crontab or interval schedule, timezone, check-in margin, max runtime, failure and recovery thresholds), or created in the UI. - Slugs are unique per project.
- Crontab parsing uses
crontabor Oban’s own cron expression parser.
- Upserted from
- Check-ins:
in_progress, thenokorerror, matched bycheck_in_id; an unknown id is a new check-in.- Duration is taken from the payload or the pair.
- sentry-elixir’s Oban and Quantum integrations work unchanged.
- Minutely cron job: marks expected-but-missing check-ins
missed, and in-progress ones pastmax_runtimetimeout. Missed, error and timeout states cross the thresholds into monitor incidents, which alert through slice 4’s recipients. - UI: monitors list with a status timeline per monitor, and the next expected run.
GET /api/0/organizations/{o}/monitors/returns the shape sentry-cli expects.- Exit: Vigil’s own Oban cron jobs, reported through sentry-elixir, show up and alert when they’re missed.
- As built:
- Check-ins:
monitor_configupserts the monitor by slug. Without a config, a check-in for an unknown slug is dropped, as Sentry does.in_progressand its result pair bycheck_in_id, which SDKs send as 32 hex digits or hyphenated. A repeated result is ignored.- Every check-in moves
next_expected_atto the schedule’s next slot.
- Crontabs use Oban’s parser (
next_at,@dailyand friends). Time zones apply only when the runtime has a tz database; Elixir ships UTC-only and no dependency was added, so schedules are UTC until one is. - The minutely
Monitors.TickWorker:- Turns each slot past its margin into a
missedcheck-in, at most 10 per monitor per tick, then skips ahead. - Turns runs in progress past
max_runtimeintotimeout.
- Turns each slot past its margin into a
- Thresholds open and close
monitor_incidents, at most one open per monitor. Both edges alert through rules of the new kind:monitor. A notification can now carry a plain message instead of issues; email and every webhook type deliver it, and uptime (slice 8) can reuse it. GET /api/0/organizations/{org}/monitors/returns Sentry’s shape for visible projects.- Pages: the monitors list (status timeline, health, last and next run; live; inline “New monitor”), and a monitor’s detail (settings, timeline, check-ins, incidents, edit, enable/disable, admin delete). The nav link reads “Crons”.
- Tested with the real sentry-elixir 14.1 Oban cron integration, unchanged and fed Oban’s job telemetry for Vigil’s own MaintainWorker and EvaluateWorker: monitors appear, a missed nightly run opens an incident and alerts. Also tested with sentry-python’s
@monitorand sentry-cli 2.58monitors runandmonitors list. Vigil doesn’t report its own crons to itself; that would mean adding sentry-elixir as a dependency.
- Check-ins:
8. Uptime · medium · done
- Monitors: HTTP GET, HTTP POST, ping, TCP, SSL expiry, and heartbeat (push to
/api/0/organizations/{o}/heartbeat_check/{uuid}/). - Checks:
- Self-rescheduling Oban jobs in the
checksqueue. - HTTP checks use Req, with expected status and body, a timeout, and an SSRF guard that blocks private addresses.
monitor_checksis partitioned daily; “up” heartbeats aren’t stored.
- Self-rescheduling Oban jobs in the
- Alerts on up/down changes, through slice 4.
- Status pages: public or private, slugged, live via PubSub.
- Exit: monitors flip state within one interval and alert once per change.
- As built:
- Check types:
ping: HTTP HEAD, where any answer is up, as GlitchTip’s “Ping” (it isn’t ICMP).get/post: expected status, any 2xx when unset, plus expected body, read up to 2 MB.tcp: a connection tohost:port.ssl: a verified TLS handshake, down when the certificate expires withinssl_warn_days. GlitchTip only reports TLS errors.heartbeat: a push to/api/0/organizations/{o}/heartbeat_check/{token}/, POST or GET; down after an interval plus grace of silence.
- Every target, and every HTTP redirect hop (followed by hand, at most 5), goes through
Vigil.Outbound, which gainedallow_privateandcheck_host/2for TCP and TLS targets. CheckWorker(queuechecks) queues its successor before checking, one queued per monitor. The minutelyReconcileWorkerrestarts chains that stopped.uptime_checksis partitioned daily (30 days). Heartbeats that are up and change nothing aren’t stored. A flip alerts once through rules of the new kind:uptime; the first result alerts only if it is down.- Pages: the org-level uptime list (state, 24h uptime, check strip; live) and detail (response-time chart, 24h/7d/30d, changes, checks, heartbeat URL with curl), status page management (
org:write), and/status/{org}/{slug}, public or members-only and live. The public page shows names and states, never targets or reasons. A private page someone can’t see looks the same as a missing one. - Tested against a real HTTP server on loopback: down and back each caught on the next check, one alert per change.
- Not done: the list page queries per monitor (unbatched).
- Check types:
9. Logs · medium · done
logitems arrive from Python asversion: 2and from Elixir with no version.- Storage: flattened attributes (service, environment, host, severity) in a partitioned
log_eventstable. Logs more than a day off server time are rejected. - UI:
- A live tail over PubSub.
- Filters for level, service, environment and attributes.
- Search.
- Jumps to the trace or issue by
trace_id.
- Exit: sentry-elixir’s logger handler streams into the tail.
- As built:
- Both SDKs send
{items: [{timestamp, level, body, trace_id, span_id, attributes: {k: {value, type}}}]}; Python addsversion: 2. One processor flattens attributes and lifts environment, release, service and host out of thesentry.*,service.*andserver.*attributes. - Lines more than a day from the server clock are dropped and counted as a new
:serveroutcome (log_item,timestamp). log_eventsis partitioned daily (30 days), with a pg_trgm index on the body.- Search syntax: words,
level:warn,error,env:,service:,host:,release:,trace:, anyattribute.key:value, quotes, and-to negate. The live tail filters new lines with the same filters. - Page:
- a log explorer with level chips and environment/service menus that edit the query in the URL
- a per-minute volume chart
- rows that expand to all attributes, with “add as filter”
- links to the trace and the trace’s issue
- a live tail with pause and “N new lines”, and “load older” by cursor
- The trace page lists the trace’s logs.
- Tested with the real sentry-elixir 14.1 logger handler (
config :sentry, logs: [level: :info]) and sentry-python 3.0.2, which sends logs by default;enable_logswas removed in 3.x.
- Both SDKs send
10. Release health · small-medium · done
sessionandsessionsitems roll up into per-release, per-environment, per-hour crash-free counts.- Release pages show crash-free users and sessions and adoption.
- As built:
- Only sentry-python sends sessions; sentry-elixir has none.
sessionitems (application mode):initcounts a start, and a final status counts once asexited(orerroredwith errors),abnormalorcrashed.sessionsitems (request mode): each aggregate bucket’s total counts as started.- Counts go into
session_countsper (project, release, environment, hour), partitioned weekly and kept 400 days. Users go intosession_usersper day, as a SHA-256 of the SDK’sdidwith a crashed flag, kept 90 days. - Sessions without a release, or over 5 days old, are dropped; old ones count as a
:serveroutcome. One that started before this week’s partition counts in its arrival hour. - Crash-free sessions = 1 − crashed/started. Crash-free users counts per-day users. Adoption = the release’s share of the project’s sessions over 24h.
- The releases list has a crash-free · adoption column. A release’s page has health tiles and an hourly sessions chart, with crashes in the error colour.
- Tested with the real sentry-python 3.0.2: request-mode aggregates plus an application session that crashes.
11. Retention and operations · medium · done
- Retention per type, settable per org: events and logs 90 days, releases 365 days. Old partitions are dropped. Orphaned issues, blobs and bundles are swept, and soft-deleted orgs and projects are removed by Oban jobs.
- Health:
/_health/and/api/0/internal/health/;/metricsfor Prometheus via telemetry. - Dogfooding: Vigil reports its own errors, crons and traces to itself through sentry-elixir. A loop guard drops events about the ingest path itself.
- Packaging:
- Dockerfile with a pinned rustup toolchain for the NIFs.
- Forgejo CI: precommit, clippy, audit.
- rel overlays for
bin/invite,bin/migrateandbin/token. - Mail through the siblings’ setup (gen_smtp or mail-prism).
- Optional:
- An MCP endpoint with the same Bearer tokens, offering issue, event and log tools as GlitchTip’s MCP server does.
- The sentry-wizard endpoints.
- The DSN-keys API.
- As built:
- Retention:
- Organizations may keep less than the instance’s partition limits (
event_,log_,release_retention_days, under Settings → General). - The daily
Retention.SweepWorkerdeletes rows past an org’s shorter limit, issues whose last event is past it, and issues soft-deleted over a day ago. - It also deletes releases older than the release limit with no issue seen since, plus orphaned artifact bundles and their stored files.
- It queues a
PurgeWorkerper project or organization soft-deleted over a day ago.
- Organizations may keep less than the instance’s partition limits (
- Health:
/_health/(liveness) and/api/0/internal/health/(readiness, Sentry’s shape) are served byVigilWeb.HealthPlug, ahead of sessions.- Prometheus
/metrics(telemetry_metrics_prometheus_core) is off unlessMETRICS_TOKENorMETRICS_PUBLICis set. Ingest emits[:vigil, :ingest, :accepted | :processed], and backlog gauges are polled.
- Dogfooding: sentry-elixir 14.1 is a dependency, inert until
VIGIL_SELF_DSN. It reports errors (logger handler,PlugCapture), Oban errors and every cron as a monitor.Vigil.SelfReport.before_send/1drops events whose request, Oban worker or stack frames are the ingest path. Tested end to end against the instance itself. Traces aren’t reported: that needs OpenTelemetry deps. - Packaging:
- The Dockerfile is Debian, Elixir 1.20.4 / OTP 28.5, with rustup 1.92.0 for the NIFs; the runner adds nothing for them, runs as
nobody, and keeps storage in/data/storage. - Forgejo
checks.yml(cargo fmt and clippy per crate,mix precommiton Postgres 17),audit.yml(osv-scanner over mix.lock and the Cargo.locks) andimage.yml. bin/tokenandmix vigil.token.- SMTP through gen_smtp (
SMTP_*,MAIL_FROM_*), falling back to the log adapter. - libcluster’s Kubernetes topology when
POD_IPis set. docs/deploy.mdlists every variable.- The image build and the workflows haven’t been run, since docker isn’t available here; the release itself was built and booted.
- The Dockerfile is Debian, Elixir 1.20.4 / OTP 28.5, with rustup 1.92.0 for the NIFs; the runner adds nothing for them, runs as
- Not done: the optional MCP endpoint and sentry-wizard. The DSN-keys API moved to slice 12.
- Retention:
12. Native, mobile and the vgl CLI · large · done
- Debug information file assemble (
/projects/{o}/{p}/files/difs/assemble/), Proguard mappings, minidump processing, and native and JVM symbolication throughvigil_symbolic.- As built (native):
vigil_symbolicNIF on getsentry’s symbolic 12 (debuginfo, symcache, demangle without Swift), proguard 5 and rust-minidump 0.26; dirty schedulers, capped inputs and outputs. zstd (ELF’s compressed debug sections) is compiled in statically; nothing links a system library.- Chunk upload now also offers
debug_files,pdbs,portablepdbsandproguard(source bundles, BCSymbolMaps and il2cpp are not offered).difs/assemble/answers per checksum (not_foundwith missing chunks,created,assembling,okwith Sentry’sDebugInfoFile,errortold once), assembled by an Oban job intodebug_files(one row per object: debug id, code id, arch, kind, format, features). The legacyfiles/dsyms/zip upload (whatupload-proguardsends by default), its list,unknown/?checksums=andDELETE ?id=work too. - SymCaches are built at the first lookup and kept in storage. Native frames resolve against
debug_meta.imagesby address oraddr_mode: rel:N, return addresses adjusted with symbolic’s heuristics, inlined frames expanded,raw_stacktracekept,in_appfalse for system libraries; a missing file is onenative_missing_dsymper image. Proguard frames and exception types are deobfuscated by the event’sproguardimages (inlined frames expanded). - Minidumps (multipart
upload_file_minidump, or an envelopeevent.minidumpattachment folded with its event at the edge) are unwound without symbols (stack scanning and frame pointers) into threads, a synthetic crash exception, images and OS/device contexts as 2019 Sentry did, then symbolicated like any native event. The raw dump is kept inevent_attachments(50 MiB cap, swept with the event retention). - Tested with the real sentry-cli 2.58.2:
debug-files upload --waitof a gcc-built ELF (committed with its source) to a symbolicated crash, andupload-proguardboth ways. - Purging a deleted project also deletes its debug files’, symcaches’ and minidumps’ bytes from storage.
- Not done: CFI from uploaded files for minidump unwinding (so scanned stacks can carry spurious frames), Swift demangling, source bundles and source context, a UI for debug files, Proguard caches (each event parses the mapping).
- As built (native):
- Project management API, in Sentry’s shapes so Terraform-style tools work too:
GET /organizations/{o}/teams/.POST /teams/{o}/{team}/projects/.GET/PUT/DELETE /projects/{o}/{p}/.- DSN keys:
GET/POST /projects/{o}/{p}/keys/andDELETE …/keys/{id}/. - Each needs the scopes Sentry asks for.
- The Vigil CLI, invoked as
vgl: a Rust/clap client incli/(binary and packages namedvgl), built the way gitgud’sggis.vgl loginstores credentials in~/.config/vigil/config.toml(mode 0600);VIGIL_URL/VIGIL_TOKENoverride them.- Commands:
whoamiorgs,teamsprojects list/create/show/edit/deletekeys list/create/revoke, with adsnshortcutissues list/resolvereleasesandmonitorsread-onlyuptime list
- JSON output with
--json. - Packaged as .deb and .rpm (cargo-deb, cargo-generate-rpm) by CI, as
ggis. - Done (API and CLI):
- Teams (
GET/POST /organizations/{o}/teams/), team projects, project details, keys (PUTtoo: rename,isActive,rateLimit), andGET/PUT /projects/{o}/{p}/issues/for sentry-cli’sissues list/resolve/mute/unresolve, with Sentry’s scopes and team visibility. An issue’s API id is its short id, as in the web UI’s URLs.GET /organizations/{o}/uptime/is Vigil’s own, forvgl uptime list. cli/: every command above pluslogoutandissues unresolve/ignore;VIGIL_ORG/VIGIL_PROJECTand saved defaults.checks.ymlruns its fmt/clippy/tests and builds it fortest/vigil_web/vgl_cli_test.exs;cli.ymlbuilds and publishes the packages viacli/Dockerfile.
- Teams (
13. Android app · medium · done
- A read-only Kotlin/Compose client in
android/, built the way the sibling apps’ are (gitgud’s pairing, bigtrippr’s shell, the neiam themes and B612), published byandroid.ymlto the forge’s F-Droid repository.- As built:
- Settings → API tokens has a Mobile app box that ticks the read bundle (
org:read project:read team:read member:read event:read,Vigil.ApiTokens.mobile_scopes/0). A new token covering it is shown with avigil://pair?base=…&token=…QR (EQRCode, as gitgud) and link. The app verifies againstGET /api/0/before storing, and names any missing scope. A paired phone is its token: revoking it signs the phone out. - New in
/api/0, Sentry-shaped:GET /organizations/{o}/issues/(every visible project’s issues, or?project=, with the issue search and Link cursors);GET /projects/{o}/{p}/issues/{id}/(group details: releases and a tag summary);GET /projects/{o}/{p}/issues/{id}/events/latest/(Sentry’s event withentries: exception, message, breadcrumbs, request; frames withcontext, nevervars). Issue lists now carryuserCount, from theusertag. - The app: org picker (skipped with one), issues (search, status, project, paging, pull to refresh), an issue with its latest event, cron and uptime monitors.
test/vigil_web/api/android_fixtures_test.exswrites the responses the app’s contract test decodes.
- Settings → API tokens has a Mobile app box that ticks the read bundle (
- As built:
Decisions to make
| # | Question | Recommendation |
|---|---|---|
| 1 | Grouping: which strategy by default? | Every strategy is supported side by side (slice 2). The default is 2019 Sentry newstyle:2019-10-29, because title-based grouping merges unrelated errors that share a message and splits one error whose message carries ids. glitchtip:compat is there for anyone who wants GlitchTip’s behaviour |
| 3 | Where ingest payloads wait: a buffer table plus Drain jobs, or payloads in Oban args? | The buffer table (see Architecture) |
| 4 | Org invites and registration invites: one table or two? | Two tables, one flow. An org invite to an address without an account behaves as an addressed registration invite |
| 5 | Span volume: every span in Postgres? | Yes, partitioned daily with short retention (7 to 14 days) and rollups kept longer. Revisit cold storage (Parquet) only if volume demands it |
| 6 | Multi-node: libcluster from the start? | Not until slice 11. Ingest is stateless apart from the ETS caches, which PubSub keeps coherent once clustered |