From f1d88e8fb375d01c3947819de56a3ba596a74174 Mon Sep 17 00:00:00 2001 From: jbergner Date: Mon, 18 May 2026 09:41:14 +0200 Subject: [PATCH] Agent Metrics Bugfix --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 2df9de9..5492707 100644 --- a/main.go +++ b/main.go @@ -5269,6 +5269,13 @@ func buildSQLMatchCondition(r DynamicRule) (string, []any) { } func (s *server) runDetectionsOnce() { + ctx, cancel := context.WithTimeout(context.Background(), s.cfg.DetectionInterval) + defer cancel() + + if err := s.detector.updateAgentMetrics(ctx); err != nil { + s.logger.Printf("update agent metrics: %v", err) + } + type ruleSpec struct { name string timeout time.Duration