Files
cairnobs/hack
jcoffey-dev d05ebe046c Make the demo reset survive a slow start, and drop the SQL panels
Two faults, both found by running the reset against the demo rather than
by reading it, and both fixed on the box before this commit existed.

The reset raced its own alerting container. Writing .env changes
alerting's environment, so `docker compose up -d alerting` recreates it
-- and the next line posted notification targets to it with no wait. On a
busy box that lost: curl returned nothing, json.load threw on an empty
string, and set -e killed the script. The damage is in the ordering:
`docker compose down -v` runs near the top, so any failure after it
leaves the public demo up, empty, and with the simulator still stopped,
because the unit is only restarted on the last line. It has been
surviving nightly on timing alone. It now polls /healthz for up to 60
seconds and fails loudly before the seed rather than after the wipe.

Five dashboard panels were raw ClickHouse SQL, which dashboards refuse:
validatePanel rejects query_language "sql" outright, because the
time-range picker is injected as leading query terms and a SELECT has
nowhere to put them. They were written that way because the pipe syntax
has no time bucketing -- no timechart, no bin -- so a genuine time series
is not available to a dashboard panel at all. Each is now the breakdown
the panel was actually asking for: kubelet events by kind and host, DNS
by type and result, queue depth by queue and host, IIS by site and host,
HAProxy by backend and balancer.

Both mistakes were mine and both were avoidable by reading: the rule
about pipe-syntax-only dashboards is stated in terraform/README.md, and I
had already read the line that says it.

Verified on the demo: 50 hosts, 24 services, 1,922,128 records, all 13
dashboards and all 11 alert rules applied, simulator active. `system`
appears on exactly 31 hosts, which is the Linux count -- no Windows host
was given a journald stream.
2026-09-04 15:55:43 -07:00
..
2026-08-21 20:53:32 -07:00
2026-08-21 20:53:32 -07:00

hack

Local developer tooling that isn't part of any shipped component — scripts you run against your own machine/dev stack, not code that ends up in a container image (except dev-certs' output, which mounts into the ingest container).

Not one of the top-level directories in the original monorepo scaffold — added because dev-only mTLS cert generation didn't have a natural home in /deploy (real deployment manifests), /transport, or any other existing component. /hack is the conventional name for this in a lot of larger Go monorepos (Kubernetes among them).

  • dev-certs/ — generates a throwaway CA + server/client cert pair for local mTLS between the agent and ingest. See /docs/phase-0-runbook.md for when to run it.
  • windows-fixture/ — sends synthetic Windows Event Log-shaped records directly to ingest, bypassing the real Windows agent. Tests whether the pipeline handles Windows-shaped data; doesn't test the real EvtSubscribe/ETW integration, which needs actual Windows. See /docs/phase-1-runbook.md.
  • demo-simulator/ — the public demo's synthetic world: a fictional fleet whose agents check in, report CPU/memory/disk, and ship realistically shaped logs for eight services. Backfills a window of history, then keeps generating in real time. Distinct from benchmark-fixture/ (volume, for the Phase 2 latency benchmark) and windows-fixture/ (correctness, for the Windows ingest path).
  • check-web-routes.sh — asserts web/nginx.conf's hand-maintained route allowlists still match web/src/routes. nginx.conf 404s unknown paths, so it has to name the routes that have no prerendered file to match (dynamic ones, and any route without prerender = true). Drift here breaks production only — dev and npm run preview never read nginx.conf — so this runs in CI, like check-tenant-boundary.sh.
  • demo-seed/ — the rest of the demo deployment: its reset script, dashboards, alert rules, and the systemd unit that runs demo-simulator.