Architecture¶
Components¶
monitoring tools ──► web server (nginx) ──► backend (Go) ──► PostgreSQL 16
browsers ──► serves the app one binary, all state
Argavon agents ──► proxies /api any number of
replicas
- Web server: nginx serving the built React app and proxying
/apito the backend (long reads for the live log stream, 10 MB request bodies for OTLP and agent batches). - Backend: one Go binary (
backend/cmd/server): HTTP API, ingest, correlation, paging workers, schedulers. No web framework and no ORM:net/http, plain SQL, one store per table group. - PostgreSQL: the only state. Migrations are numbered SQL files
(
backend/internal/store/migrations/NNN_name.sql) embedded in the binary and applied in order at start under an advisory lock.
What happens to an alert¶
- Ingest: a source token (or an agent's HMAC signature) identifies the workspace; the payload is normalized into an event and stored. Unparseable payloads go to the dead-letter queue.
- Mutes are checked first: a muted alert is stored and logged but goes no further.
- Correlation (
services/correlation_service.go), under a per-workspace-and-service lock: a repeat of an open incident's alert is linked to it; otherwise an open incident with the same fingerprint, or for the same or a dependent service within the window, takes it; otherwise a new incident starts. A unique index on open fingerprints stops two replicas creating the same incident. Details. - A new incident notifies its listeners: escalation (which picks a route and pages step 1), the status page (for published services), setup progress and metrics.
- Paging: a page becomes rows in
notification_deliveries, one per contact method and rule delay. Workers on every replica claim due rows (FOR UPDATE SKIP LOCKED), send them, and retry with backoff; acknowledging the incident cancels what is still pending. Email goes through an outbox table the same way. - Recovery: when every alert of an incident has recovered and stays quiet for
AUTO_CLOSE_QUIET_PERIOD(5 minutes), the incident closes itself.
Sample incidents (made up for new workspaces) take a separate path: they never join real incidents and none of the listeners above run for them.
Editions and enterprise code¶
PLATFORM_EDITIONS decides which route groups are registered at start (core, enterprise,
agent, saasops); a switched-off module has no routes at all. Separately, enterprise features
check a license entitlement on each request and answer 403 ENTERPRISE_FEATURE without one; one
check serves both self-hosted license keys and cloud plans.
Enterprise-only code lives in backend/ee and frontend/src/ee (Argavon Enterprise License) and
plugs in through one extension point; the core never imports it. make build-foss builds without it.
Security model¶
- Workspaces are isolated by the credential: the workspace comes from the verified session, API
key, source token or agent signature, never from a header, query parameter or body. Every lookup by
id also filters by workspace, so another workspace's id looks exactly like a missing one. The
integration tests in
backend/internal/appcheck this for every resource with two workspaces. - The database keeps workspaces apart too (row-level security). Every table with a
tenant_idcolumn has a forced Postgres policy, and every query runs in a short transaction that names its workspace (app.tenant_id, transaction-local, so it is safe behind PgBouncer) and switches to the roleneuroops_app(DB_APP_ROLE), which cannot bypass the policies even whenPOSTGRES_DSNlogs in as a superuser. A query that forgets itsWHERE tenant_idstill sees only its own workspace, and one that names no workspace sees nothing. The few that must cross workspaces on purpose (sign-in by email, API-key lookup, background sweeps, the platform operator) say so in the code. The server sets this up on every start, so a new table is covered without anyone remembering to, and a production server refuses to start if the policies would be bypassed. A test signs in as one workspace and calls every read route of the API with another workspace's ids, and finds none of its data. - Passwords are hashed with argon2id. Sessions are signed tokens with issuer, audience and
id checks; signing out everywhere, changing a password or disabling a user revokes them on every
replica at once. The web app uses an httpOnly, SameSite=Strict cookie (page scripts never see the
token) and must send
X-Requested-With: neuroopson writes; API clients send bearer tokens. - Secrets at rest (integration credentials) are sealed with AES-256-GCM using
MASTER_ENCRYPTION_KEY. API keys, invite tokens and enrollment tokens are stored only as hashes and shown once; source tokens are looked up by hash and kept encrypted. - Agents enrol with a one-time token, sign every request (HMAC-SHA256 over method, agent id, time, a single-use nonce and the body hash; ±5 minutes) and only run read-only diagnostics that the platform has signed.
- Containers run as non-root users with read-only root filesystems and no Linux capabilities.
Code layout¶
backend/
cmd/server the server; cmd/licensegen, cmd/docgen
internal/app wiring, and the integration tests (real Postgres)
internal/routes route registration; entitlement rules
internal/handlers HTTP: decode, call a service, encode
internal/services business logic
internal/store SQL; migrations in migrations/*.sql
internal/ingest one normalizer per source
internal/notifier email, SMS/voice, push, webhook, chat channels
ee/ enterprise modules: sso, scim, rbac
frontend/src
components/ pages, lazily loaded; ee/ for enterprise pages
api/ one fetch client; a 401 ends the session everywhere
neuroops-agent/ the host agent (separate Go module)
deploy/ nginx config, Helm chart, Zabbix media type
docs/ this site