mirror of https://github.com/milvus-io/milvus.git
enhance: Add compaction type label to metrics (#29485)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>pull/29539/head
parent
c45f8a2946
commit
fe04598900
|
@ -613,7 +613,7 @@ func (t *compactionTask) compact() (*datapb.CompactionPlanResult, error) {
|
|||
)
|
||||
|
||||
log.Info("compact overall elapse", zap.Duration("elapse", time.Since(compactStart)))
|
||||
metrics.DataNodeCompactionLatency.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Observe(float64(t.tr.ElapseSpan().Milliseconds()))
|
||||
metrics.DataNodeCompactionLatency.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), t.plan.GetType().String()).Observe(float64(t.tr.ElapseSpan().Milliseconds()))
|
||||
metrics.DataNodeCompactionLatencyInQueue.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Observe(float64(durInQueue.Milliseconds()))
|
||||
|
||||
planResult := &datapb.CompactionPlanResult{
|
||||
|
|
|
@ -18,6 +18,7 @@ package datanode
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/samber/lo"
|
||||
|
@ -33,6 +34,7 @@ import (
|
|||
"github.com/milvus-io/milvus/internal/storage"
|
||||
"github.com/milvus-io/milvus/pkg/common"
|
||||
"github.com/milvus-io/milvus/pkg/log"
|
||||
"github.com/milvus-io/milvus/pkg/metrics"
|
||||
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
||||
"github.com/milvus-io/milvus/pkg/util/merr"
|
||||
"github.com/milvus-io/milvus/pkg/util/metautil"
|
||||
|
@ -227,6 +229,8 @@ func (t *levelZeroCompactionTask) compact() (*datapb.CompactionPlanResult, error
|
|||
Channel: t.plan.GetChannel(),
|
||||
}
|
||||
|
||||
metrics.DataNodeCompactionLatency.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), t.plan.GetType().String()).
|
||||
Observe(float64(t.tr.ElapseSpan().Milliseconds()))
|
||||
log.Info("L0 compaction finished", zap.Duration("elapse", t.tr.ElapseSpan()))
|
||||
|
||||
return result, nil
|
||||
|
|
|
@ -161,6 +161,7 @@ var (
|
|||
Buckets: longTaskBuckets,
|
||||
}, []string{
|
||||
nodeIDLabelName,
|
||||
compactionTypeLabel,
|
||||
})
|
||||
|
||||
DataNodeCompactionLatencyInQueue = prometheus.NewHistogramVec(
|
||||
|
|
|
@ -64,6 +64,7 @@ const (
|
|||
ReduceSegments = "segments"
|
||||
ReduceShards = "shards"
|
||||
|
||||
compactionTypeLabel = "compaction_type"
|
||||
nodeIDLabelName = "node_id"
|
||||
statusLabelName = "status"
|
||||
indexTaskStatusLabelName = "index_task_status"
|
||||
|
|
Loading…
Reference in New Issue