From 854fb6aad202b2ad86b8eb99d314f7c16fe29f46 Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Wed, 9 Nov 2022 17:45:04 +0800 Subject: [PATCH] Fix querycoord metrics (#20429) Signed-off-by: longjiquan Signed-off-by: longjiquan --- internal/querycoordv2/server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/querycoordv2/server.go b/internal/querycoordv2/server.go index b32c300438..f525c4fcc4 100644 --- a/internal/querycoordv2/server.go +++ b/internal/querycoordv2/server.go @@ -296,6 +296,12 @@ func (s *Server) initObserver() { ) } +func (s *Server) afterStart() { + now := time.Now() + Params.QueryCoordCfg.CreatedTime = now + Params.QueryCoordCfg.UpdatedTime = now +} + func (s *Server) Start() error { log.Info("start watcher...") sessions, revision, err := s.session.GetSessions(typeutil.QueryNodeRole) @@ -348,6 +354,8 @@ func (s *Server) Start() error { } log.Info("QueryCoord started") + s.afterStart() + return nil }