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,