Fix metric ProxySyncTimeTickLag (#23235) (#23282)

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
pull/23333/head
Jiquan Long 2023-04-10 11:12:38 +08:00 committed by GitHub
parent a92109735e
commit 531bc4a297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 2 deletions

View File

@ -311,8 +311,24 @@ func (node *Proxy) sendChannelsTimeTickLoop() {
Timestamps: tss,
DefaultTimestamp: maxTs,
}
sub := tsoutil.SubByNow(maxTs)
metrics.ProxySyncTimeTickLag.WithLabelValues(strconv.FormatInt(Params.ProxyCfg.GetNodeID(), 10), "default").Set(float64(sub))
func() {
// we should pay more attention to the max lag.
minTs := maxTs
minTsOfChannel := "default"
// find the min ts and the related channel.
for channel, ts := range stats {
if ts < minTs {
minTs = ts
minTsOfChannel = channel
}
}
sub := tsoutil.SubByNow(minTs)
metrics.ProxySyncTimeTickLag.WithLabelValues(strconv.FormatInt(Params.ProxyCfg.GetNodeID(), 10), minTsOfChannel).Set(float64(sub))
}()
status, err := node.rootCoord.UpdateChannelTimeTick(node.ctx, req)
if err != nil {
log.Warn("sendChannelsTimeTickLoop.UpdateChannelTimeTick", zap.Error(err))