From d03b9cc052ba156ffd7b05521d5b26055a438ae3 Mon Sep 17 00:00:00 2001 From: "yihao.dai" Date: Sun, 21 Dec 2025 19:03:17 +0800 Subject: [PATCH] enhance: Align the monitoring of last_replicated_time_tick with wal_last_confirm_time_tick (#46469) issue: https://github.com/milvus-io/milvus/issues/46116 Signed-off-by: bigsheeper --- internal/cdc/replication/replicatestream/metrics.go | 3 ++- pkg/metrics/cdc_metrics.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/cdc/replication/replicatestream/metrics.go b/internal/cdc/replication/replicatestream/metrics.go index 922b336af6..b323f02c08 100644 --- a/internal/cdc/replication/replicatestream/metrics.go +++ b/internal/cdc/replication/replicatestream/metrics.go @@ -23,6 +23,7 @@ import ( "github.com/milvus-io/milvus/pkg/v2/proto/streamingpb" "github.com/milvus-io/milvus/pkg/v2/streaming/util/message" "github.com/milvus-io/milvus/pkg/v2/util/timerecord" + "github.com/milvus-io/milvus/pkg/v2/util/tsoutil" "github.com/milvus-io/milvus/pkg/v2/util/typeutil" ) @@ -90,7 +91,7 @@ func (m *replicateMetrics) OnConfirmed(msg message.ImmutableMessage) { metrics.CDCLastReplicatedTimeTick.WithLabelValues( m.replicateInfo.GetSourceChannelName(), m.replicateInfo.GetTargetChannelName(), - ).Set(float64(msg.TimeTick())) + ).Set(tsoutil.PhysicalTimeSeconds(msg.TimeTick())) } func (m *replicateMetrics) OnInitiate() { diff --git a/pkg/metrics/cdc_metrics.go b/pkg/metrics/cdc_metrics.go index c35d313623..aa671c3323 100644 --- a/pkg/metrics/cdc_metrics.go +++ b/pkg/metrics/cdc_metrics.go @@ -33,7 +33,7 @@ const ( // CDC metric labels CDCLabelTargetCluster = "target_cluster" - CDCLabelSourceChannelName = "source_channel_name" + CDCLabelSourceChannelName = WALChannelLabelName CDCLabelTargetChannelName = "target_channel_name" CDCLabelMsgType = msgTypeLabelName CDCLabelConnectionStatus = "connection_status" @@ -87,7 +87,7 @@ var CDCLastReplicatedTimeTick = prometheus.NewGaugeVec( Namespace: milvusNamespace, Subsystem: typeutil.CDCRole, Name: CDCMetricLastReplicatedTimeTick, - Help: "The time tick of the last replicated message", + Help: "The time tick in seconds of the last replicated message", }, []string{ CDCLabelSourceChannelName, CDCLabelTargetChannelName,