enhance: change cp metric to absolute unix ts (#29328)

See also #29327

Change channel checkpoint metrics to unix seconds instead of checkpoint
timestamp lag value

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2023-12-20 11:04:45 +08:00 committed by GitHub
parent 61fc822207
commit cbf0f9c527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -1270,8 +1270,8 @@ func (m *meta) UpdateChannelCheckpoint(vChannel string, pos *msgpb.MsgPosition)
zap.Uint64("ts", pos.GetTimestamp()),
zap.ByteString("msgID", pos.GetMsgID()),
zap.Time("time", ts))
metrics.DataCoordCheckpointLag.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), vChannel).
Set(float64(time.Since(ts).Milliseconds()))
metrics.DataCoordCheckpointUnixSeconds.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), vChannel).
Set(float64(ts.Unix()))
}
return nil
}

View File

@ -588,7 +588,7 @@ func (s *Server) DropVirtualChannel(ctx context.Context, req *datapb.DropVirtual
s.compactionHandler.removeTasksByChannel(channel)
metrics.CleanupDataCoordNumStoredRows(collectionID)
metrics.DataCoordCheckpointLag.DeleteLabelValues(fmt.Sprint(paramtable.GetNodeID()), channel)
metrics.DataCoordCheckpointUnixSeconds.DeleteLabelValues(fmt.Sprint(paramtable.GetNodeID()), channel)
// no compaction triggered in Drop procedure
return resp, nil

View File

@ -117,12 +117,12 @@ var (
channelNameLabelName,
})
DataCoordCheckpointLag = prometheus.NewGaugeVec(
DataCoordCheckpointUnixSeconds = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: milvusNamespace,
Subsystem: typeutil.DataCoordRole,
Name: "channel_checkpoint_ts_lag_ms",
Help: "channel checkpoint timestamp lag in milliseconds",
Name: "channel_checkpoint_unix_seconds",
Help: "channel checkpoint timestamp in unix seconds",
}, []string{
nodeIDLabelName,
channelNameLabelName,
@ -278,7 +278,7 @@ func RegisterDataCoord(registry *prometheus.Registry) {
registry.MustRegister(DataCoordNumStoredRows)
registry.MustRegister(DataCoordNumStoredRowsCounter)
registry.MustRegister(DataCoordConsumeDataNodeTimeTickLag)
registry.MustRegister(DataCoordCheckpointLag)
registry.MustRegister(DataCoordCheckpointUnixSeconds)
registry.MustRegister(DataCoordStoredBinlogSize)
registry.MustRegister(DataCoordSegmentBinLogFileCount)
registry.MustRegister(DataCoordDmlChannelNum)