41.0 KiB · text History 2977adf

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/ (CSP report-uri) and /minidump/ are secondary. Routes work with and without the trailing slash.
  • The key is read from, in order:
    1. the sentry_key query parameter (also glitchtip_key);
    2. the X-Sentry-Auth header;
    3. the Authorization header;
    4. the envelope header dsn, which GlitchTip ignores but tunnels rely on.
  • sentry_version 5 (Elixir) and 7 (Python) are both accepted. sentry_timestamp and sentry_secret are 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-Type is ignored. Elixir sends none; Python sends application/x-sentry-envelope.
  • Content-Encoding may be gzip or deflate (zlib-wrapped, or raw deflate as a fallback), both via :zlib; zstd via OTP 28’s :zstd; or br via 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’s log and trace_metric items have no length.
  • Unknown item types are skipped and parsing continues. GlitchTip stops at the first one; Vigil must not.
  • Payloads tolerate null anywhere. exception, breadcrumbs and threads may be bare arrays or {"values": […]}. message may be a string or an object. Timestamps may be ISO strings with or without Z, or unix ints or floats.

Responses

  • Always 200 with 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: :sync returns that id to the caller.
  • 429 carries Retry-After: <int> and X-Sentry-Rate-Limits: <int>:<categories>:<scope>[:<reason>]. Use integers: Python silently drops float values.
  • 413 for 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, baggage and content-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.Partitions creates 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 Native, Proguard and minidump symbolication on symbolic and minidump. Optional; last 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 NEIAM link_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 Bearer plug 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.Partitions and 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_rules table 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. group neiam → member and neiam-admins → admin for org neiam, so a fresh install comes up already wired.
    • When it runs: NeiamAuthAdapter.apply_groups/2, which neiam_auth calls on every login for providers with GROUPS_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 only group memberships. 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 optional provision?(claims) adapter callback in neiam_auth, answered from org_group_rules.
    • A first SSO login that matches no rule follows the usual invite-only path.
  • Exit: a user can create an org and project, copy a DSN, and mint a token. A NEIAM login in group neiam-admins lands as admin of org neiam.

1. Ingest edge · large · done

  • Vigil.Ingest.Plug covering 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_items with a deferred state, not discarded, so those slices can process the backlog when they land.
  • client_report becomes 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 with result: :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.

2. Events into issues · large · done

  • Normalisation:
    • Tolerant per field, as GlitchTip: a bad interface becomes nil plus an entry in errors[], never a rejection.
    • Bare arrays and values are unified, and logentry is formatted.
    • Request headers become a sorted list, and cookies are scrubbed.
    • Client IPs are set and anonymised per project.
    • \u0000 is stripped.
  • 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. culprit is persisted, which GlitchTip forgets to do.
  • Grouping: several strategies side by side.
    • Each strategy is a Vigil.Grouping.Config module 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’s md5(title + culprit + type).
    • All of them honour fingerprint and {{ 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_hashes rows 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.
  • 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.
  • Events: partitioned by day; the data JSON is trimmed to the interfaces; event_id is unique per project, which dedupes retries.
  • Tags and stats:
    • tag_keys and tag_values dictionaries.
    • issue_tags counts per day.
    • Hourly issue_counts and project_counts.
  • Search: a tsvector over title, culprit, transaction and frame filenames, plus a trigram index on title.
  • User feedback: user_report and feedback items are linked to the issue by event_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-29 and legacy:2019-03-12, which matches all 200 of Sentry’s own grouping snapshot fixtures (100 inputs × 2 configs, whole variant trees, not just hashes), plus glitchtip:compat.
    • Stack-trace enhancement rules are Sentry’s own rule files, parsed at compile time. Projects can add rule text of their own (Vigil.Grouping opts).
    • 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 PROJECT sends test events.

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:value tag 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.
  • 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:value tags, 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 need project:admin (admins and up) instead.

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_candidates table (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.
  • 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.Outbound refuses 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.
    • version and shortVersion are both emitted.
    • dateReleased stays null until finalize; GlitchTip sets it on create.
  • Deploys and commits: deploys can be created and listed. The commits and refs sent in the release PUT are stored (GlitchTip drops them). GET /repos/ returns [], and previous-with-commits returns 404.
  • Chunk upload:
    • GET advertises artifact_bundles (and later artifact_bundles_v2).
    • POST takes multipart file_gzip parts. It verifies each SHA-1, which GlitchTip doesn’t, and stores blobs per org rather than globally.
  • Artifact-bundle assemble:
    • not_found returns the missing chunks.
    • Otherwise an Oban assemble job runs, with status tracked per (org, checksum).
    • It returns created, then assembling, then ok or error, so --wait works. GlitchTip never returns ok.
  • Bundles: extract the manifest and pair minified files with their maps by debug id or Sourcemap header, into artifact_bundle_files.
  • JS symbolication with vigil_sourcemap:
    • Match by debug id from debug_meta.images, falling back to release and filename.
    • raw_stacktrace is kept.
    • Handles webpack:, app: and ~/ prefixes, and sets in_app.
  • 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 --wait and 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/restore arrive as an org-path POST with status. Commits and refs from PUT are kept in data. Lists use Sentry’s cursor Link headers. A token sees only releases of projects it can see.
    • Chunk upload advertises release_files, artifact_bundles and artifact_bundles_v2. sentry-cli 2.58 only chunks source maps at all when release_files is offered. With no project named it uses the release-bound releases/{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 the vigil_sourcemap NIF (capped while inflating; sentry-cli’s SYSB header is handled) and extracts files with their debug ids. An error is 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 the sourcemap header, sourceMappingURL or <url>.map. raw_stacktrace is 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 --wait to a symbolicated event.

6. Performance · large · done

  • Storage:
    • Elixir sends transaction items with spans[]; Python 3.x sends span v2 items (is_segment marks the root).
    • Both normalise into one spans table, partitioned daily, with trace id, span id, parent, segment, op, name, status, start, duration and attributes.
    • Segment spans roll up into transaction_groups keyed 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.
  • 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 db spans under one parent), as GlitchTip’s MCP tools offer.
  • Exit: a Phoenix app with sentry-elixir tracing shows endpoints and waterfalls.
  • As built:
    • Ingest:
      • transaction items (sentry-elixir: the transaction is the segment, spans[] its children) and span v2 items (sentry-python 3.0 streams spans only) normalise into spans, partitioned daily with 14 days kept.
      • Each segment upserts its transaction_groups row (name, op, method), adding to count, errors, duration total and a histogram bucket in one statement, plus its hour in transaction_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 from contexts.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_exporter and opentelemetry_semantic_conventions) and the real sentry-python 3.0.2 (which also traces its own envelope POSTs as http.client spans).
    • mix vigil.test ORG PROJECT --kind transaction sends 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.

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 crontab or Oban’s own cron expression parser.
  • Check-ins:
    • in_progress, then ok or error, matched by check_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 past max_runtime timeout. 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_config upserts the monitor by slug. Without a config, a check-in for an unknown slug is dropped, as Sentry does.
      • in_progress and its result pair by check_in_id, which SDKs send as 32 hex digits or hyphenated. A repeated result is ignored.
      • Every check-in moves next_expected_at to the schedule’s next slot.
    • Crontabs use Oban’s parser (next_at, @daily and 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 missed check-in, at most 10 per monitor per tick, then skips ahead.
      • Turns runs in progress past max_runtime into timeout.
    • 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 @monitor and sentry-cli 2.58 monitors run and monitors list. Vigil doesn’t report its own crons to itself; that would mean adding sentry-elixir as a dependency.

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 checks queue.
    • HTTP checks use Req, with expected status and body, a timeout, and an SSRF guard that blocks private addresses.
    • monitor_checks is partitioned daily; “up” heartbeats aren’t stored.
  • 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 to host:port.
      • ssl: a verified TLS handshake, down when the certificate expires within ssl_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 gained allow_private and check_host/2 for TCP and TLS targets.
    • CheckWorker (queue checks) queues its successor before checking, one queued per monitor. The minutely ReconcileWorker restarts chains that stopped.
    • uptime_checks is 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).

9. Logs · medium · done

  • log items arrive from Python as version: 2 and from Elixir with no version.
  • Storage: flattened attributes (service, environment, host, severity) in a partitioned log_events table. 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 adds version: 2. One processor flattens attributes and lifts environment, release, service and host out of the sentry.*, service.* and server.* attributes.
    • Lines more than a day from the server clock are dropped and counted as a new :server outcome (log_item, timestamp).
    • log_events is partitioned daily (30 days), with a pg_trgm index on the body.
    • Search syntax: words, level:warn,error, env:, service:, host:, release:, trace:, any attribute.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_logs was removed in 3.x.

10. Release health · small-medium · done

  • session and sessions items 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.
    • session items (application mode): init counts a start, and a final status counts once as exited (or errored with errors), abnormal or crashed.
    • sessions items (request mode): each aggregate bucket’s total counts as started.
    • Counts go into session_counts per (project, release, environment, hour), partitioned weekly and kept 400 days. Users go into session_users per day, as a SHA-256 of the SDK’s did with a crashed flag, kept 90 days.
    • Sessions without a release, or over 5 days old, are dropped; old ones count as a :server outcome. 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/; /metrics for 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/migrate and bin/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.SweepWorker deletes 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 PurgeWorker per project or organization soft-deleted over a day ago.
    • Health:
      • /_health/ (liveness) and /api/0/internal/health/ (readiness, Sentry’s shape) are served by VigilWeb.HealthPlug, ahead of sessions.
      • Prometheus /metrics (telemetry_metrics_prometheus_core) is off unless METRICS_TOKEN or METRICS_PUBLIC is 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/1 drops 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 precommit on Postgres 17), audit.yml (osv-scanner over mix.lock and the Cargo.locks) and image.yml.
      • bin/token and mix vigil.token.
      • SMTP through gen_smtp (SMTP_*, MAIL_FROM_*), falling back to the log adapter.
      • libcluster’s Kubernetes topology when POD_IP is set.
      • docs/deploy.md lists 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.
    • Not done: the optional MCP endpoint and sentry-wizard. The DSN-keys API moved to slice 12.

12. Native, mobile and the vigil CLI · large

  • Debug information file assemble (/projects/{o}/{p}/files/difs/assemble/), Proguard mappings, minidump processing, and native and JVM symbolication through vigil_symbolic.
  • 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/ and DELETE …/keys/{id}/.
    • Each needs the scopes Sentry asks for.
  • The Vigil CLI, invoked as vgl: a Rust/clap client in cli/ (binary and packages named vgl), built the way gitgud’s gg is.
    • vgl login stores credentials in ~/.config/vigil/config.toml (mode 0600); VIGIL_URL / VIGIL_TOKEN override them.
    • Commands:
      • whoami
      • orgs, teams
      • projects list/create/show/edit/delete
      • keys list/create/revoke, with a dsn shortcut
      • issues list/resolve
      • releases and monitors read-only
      • uptime list
    • JSON output with --json.
    • Packaged as .deb and .rpm (cargo-deb, cargo-generate-rpm) by CI, as gg is.
    • Done (API and CLI):
      • Teams (GET/POST /organizations/{o}/teams/), team projects, project details, keys (PUT too: rename, isActive, rateLimit), and GET/PUT /projects/{o}/{p}/issues/ for sentry-cli’s issues 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, for vgl uptime list.
      • cli/: every command above plus logout and issues unresolve/ignore; VIGIL_ORG/VIGIL_PROJECT and saved defaults. checks.yml runs its fmt/clippy/tests and builds it for test/vigil_web/vgl_cli_test.exs; cli.yml builds and publishes the packages via cli/Dockerfile.

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