remove the group in raw

This commit is contained in:
larssand
2026-06-30 12:30:50 +02:00
parent 4f968eeed5
commit f95a861eb6
3 changed files with 9 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ class GraylogAggregateSource:
}
schema_variants: list[dict[str, object]] = []
metric_keys = [key for key in ("metrics", "series") if key in properties]
group_keys = [key for key in ("groupings", "group_by", "groups", "fields") if key in properties]
group_keys = [key for key in ("groupings", "fields") if key in properties]
if properties and metric_keys:
for metric_key in metric_keys:
for metric_value in (["count()"], ["count"], [{"function": "count"}]):

View File

@@ -382,6 +382,11 @@ def cached_status_with_error(cache_path: str, error_status: dict[str, object]) -
cached = StatusSnapshotStore(cache_path).load("last_good")
if not cached:
return None
for row in cached.get("stream_coverage", []) if isinstance(cached.get("stream_coverage"), list) else []:
if isinstance(row, dict):
row.setdefault("raw_error", "")
row.setdefault("aggregate_error", "")
row.setdefault("error", row.get("aggregate_error") or row.get("raw_error") or "")
cached["generated_at"] = int(time.time())
cached["stale"] = True
cached["stale_reason"] = "live_mcp_error"