feat(ingest): batch event writes and harden transport

This commit is contained in:
William Valentin
2026-03-26 11:22:42 -07:00
parent 43877a5448
commit 6605780b58
4 changed files with 65 additions and 9 deletions
+1
View File
@@ -38,6 +38,7 @@ func main() {
})
r.Post("/v1/events", func(w http.ResponseWriter, r *http.Request) {
r.Body = http.MaxBytesReader(w, r.Body, 10<<20) // 10MB limit
var events []json.RawMessage
if err := json.NewDecoder(r.Body).Decode(&events); err != nil {
httpx.WriteJSON(w, http.StatusBadRequest, map[string]any{"error": "invalid_json"})