Local Development — Ingestor
Prerequisites
Section titled “Prerequisites”- Go (matching version in
ingestor/go.mod) - SQL Server accessible locally (same instance as Cloud Backend, different schema)
- Cloud Backend running locally to register a test device and get a
device_key
cd ingestorcp .env.example .env# Edit .envgo mod downloadgo run .Environment variables
Section titled “Environment variables”| Variable | Example | Notes |
|---|---|---|
DATABASE_URL | sqlserver://sa:Pass@localhost:1433?database=monozu&encrypt=disable | Same DB as Cloud or separate |
PORT | 8081 | Ingestor listen port (avoid conflict with Cloud:8000 and Management:8080) |
Get a test device key
Section titled “Get a test device key”Before sending test events, register a device on the Cloud Backend:
curl -X POST http://localhost:8000/api/v1/devices/register \ -H "X-Provisioning-Key: <provisioning_key>" \ -H "Content-Type: application/json" \ -d '{ "name": "test-edge-001" }'
# Response: { "device_key": "..." }Provisioning keys are created per-tenant in Settings → Edge registration keys in the Cloud SPA.
Send a test event batch
Section titled “Send a test event batch”curl -X POST http://localhost:8081/v1/ingest \ -H "X-Device-Key: <device_key>" \ -H "Content-Type: application/json" \ -d '[ { "kind": "telemetry", "timestamp": "2026-06-06T10:00:00Z", "data": { "cpu_percent": 12.5, "interface": "eth0" } }, { "kind": "security_alert", "timestamp": "2026-06-06T10:00:01Z", "data": { "title": "Test alert", "severity": "low" } } ]'
# Expected: 204 No ContentTesting security alert broadcast
Section titled “Testing security alert broadcast”To verify that a security_alert event triggers the WebSocket broadcast:
- Open the Cloud SPA Security module in the browser (connects to
/api/ws/security) - Send a
security_alertingest event (as above) - The alert should appear in the SOC alert inbox within seconds