From 50320ab46bdf16cb0b1bb20dc8514bdc5728064f Mon Sep 17 00:00:00 2001 From: Homelab Cursor Date: Tue, 24 Mar 2026 13:38:50 +0100 Subject: [PATCH] fix: exclude Loki meta-logs from error-rate check (portainer feedback loop) --- homelab-ai-bot/core/loki_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homelab-ai-bot/core/loki_client.py b/homelab-ai-bot/core/loki_client.py index 83e867ab..48f01713 100644 --- a/homelab-ai-bot/core/loki_client.py +++ b/homelab-ai-bot/core/loki_client.py @@ -170,7 +170,7 @@ def check_error_rate(minutes: int = 30) -> list[dict]: alerts = [] now = datetime.now(timezone.utc) for host in all_hosts: - q = f'count_over_time({{host="{host}"}} |~ "(?i)error" [{minutes}m])' + q = f'count_over_time({{host="{host}"}} |~ "(?i)error" !~ "caller=metrics|query_hash=|executing query|scheduler_processor|Aborted connection|systemd-networkd-wait-online|context canceled|AH01630: client denied|flag evaluation succeeded|pluginsAutoUpdate" [{minutes}m])' data = _query("/loki/api/v1/query", {"query": q, "time": _ns(now)}) count = sum( int(float(r.get("value", [None, "0"])[1]))