feat(siren): Go server that serves Siren's UI in front of Alertmanager #103

Open
opened 2026-10-28 17:11:59 +00:00 by dusk-bot · 0 comments
Collaborator

Goal

Replace Siren (~83 MB, TanStack Start on Node) with one small Go binary (~10 MB target) that serves Siren's UI and passes the Alertmanager API through. It takes over alertmanager.dcunha.io and makes both the separate Siren deployment and Alertmanager's own web UI unnecessary.

Why this is small

All of Siren's Alertmanager traffic is in one file, src/lib/alertmanager/alertmanager-client.ts (Siren 1.4.40): three TanStack createServerFn calls plus a health check:

  • list alerts
  • create a silence
  • delete a silence
  • health (src/lib/health/health-check.ts)

Everything else is client-side React.

Plan

  1. Fork Siren's frontend: swap the three server functions for direct same-origin fetch calls to /api/v2/..., and build it as a static SPA instead of SSR.
  2. Go server: embed the built UI, reverse-proxy /api/v2 and /-/ to http://alertmanager.observability.svc.cluster.local:9093, serve /livez and /readyz.
  3. Container build under apps/ like apps/komfgo (UI built in one stage, Go in the next).

Alertmanager has no setting for loading a custom UI, so the switch has to happen in front of it.

Open decision (blocks the cutover)

  • Exposure. Alertmanager is on internal-gateway; Siren is on edge-gateway with a Pocket-ID OIDC client. Pick one for the merged hostname, and decide who can create silences.

Constraints

  • /-/healthy must keep reaching Alertmanager: Gatus checks https://alertmanager.dcunha.io/-/healthy.
  • vmalert and other tools use the internal service, not the hostname, so they are unaffected.
  • Upstream Siren UI updates would have to be merged into the fork by hand.

Cheaper fallback (no memory win)

Split by path on the HTTPRoute: /api/v2 and /-/ go to Alertmanager, everything else to Siren. About 30 minutes, no code.

## Goal Replace Siren (~83 MB, TanStack Start on Node) with one small Go binary (~10 MB target) that serves Siren's UI and passes the Alertmanager API through. It takes over `alertmanager.dcunha.io` and makes both the separate Siren deployment and Alertmanager's own web UI unnecessary. ## Why this is small All of Siren's Alertmanager traffic is in one file, `src/lib/alertmanager/alertmanager-client.ts` (Siren 1.4.40): three TanStack `createServerFn` calls plus a health check: - list alerts - create a silence - delete a silence - health (`src/lib/health/health-check.ts`) Everything else is client-side React. ## Plan 1. Fork Siren's frontend: swap the three server functions for direct same-origin `fetch` calls to `/api/v2/...`, and build it as a static SPA instead of SSR. 2. Go server: embed the built UI, reverse-proxy `/api/v2` and `/-/` to `http://alertmanager.observability.svc.cluster.local:9093`, serve `/livez` and `/readyz`. 3. Container build under `apps/` like `apps/komfgo` (UI built in one stage, Go in the next). Alertmanager has no setting for loading a custom UI, so the switch has to happen in front of it. ## Open decision (blocks the cutover) - **Exposure.** Alertmanager is on `internal-gateway`; Siren is on `edge-gateway` with a Pocket-ID OIDC client. Pick one for the merged hostname, and decide who can create silences. ## Constraints - `/-/healthy` must keep reaching Alertmanager: Gatus checks `https://alertmanager.dcunha.io/-/healthy`. - vmalert and other tools use the internal service, not the hostname, so they are unaffected. - Upstream Siren UI updates would have to be merged into the fork by hand. ## Cheaper fallback (no memory win) Split by path on the HTTPRoute: `/api/v2` and `/-/` go to Alertmanager, everything else to Siren. About 30 minutes, no code.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Exikle/containers#103
No description provided.