Skip to content

Local Development — Ingestor

  • 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
Terminal window
cd ingestor
cp .env.example .env
# Edit .env
go mod download
go run .
VariableExampleNotes
DATABASE_URLsqlserver://sa:Pass@localhost:1433?database=monozu&encrypt=disableSame DB as Cloud or separate
PORT8081Ingestor listen port (avoid conflict with Cloud:8000 and Management:8080)

Before sending test events, register a device on the Cloud Backend:

Terminal window
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.

Terminal window
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 Content

To verify that a security_alert event triggers the WebSocket broadcast:

  1. Open the Cloud SPA Security module in the browser (connects to /api/ws/security)
  2. Send a security_alert ingest event (as above)
  3. The alert should appear in the SOC alert inbox within seconds