feat(query-api): add richer stats and retention

This commit is contained in:
William Valentin
2026-03-26 11:22:34 -07:00
parent fdfcb50e80
commit 43877a5448
10 changed files with 583 additions and 85 deletions
+4 -2
View File
@@ -14,7 +14,9 @@ var validTypes = map[string]bool{
"span.end": true,
"error": true,
"metric.snapshot": true,
"openclaw.snapshot": true,
"openclaw.snapshot": true,
"swarm.snapshot": true,
"swarm.service.snapshot": true,
}
type ValidationError struct {
@@ -62,7 +64,7 @@ func Validate(m map[string]any) error {
}
// Source is optional for openclaw.snapshot events
if eventType != "openclaw.snapshot" {
if eventType != "openclaw.snapshot" && eventType != "swarm.snapshot" && eventType != "swarm.service.snapshot" {
source, ok := event["source"].(map[string]any)
if !ok {
return ValidationError{Field: "event.source", Message: "missing or invalid"}