2022-03-02 14:49:55 +08:00
|
|
|
// Licensed to the LF AI & Data foundation under one
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
// distributed with this work for additional information
|
|
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance
|
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package metrics
|
|
|
|
|
|
|
|
import (
|
2022-11-07 10:15:02 +08:00
|
|
|
"fmt"
|
|
|
|
|
2022-06-02 16:06:03 +08:00
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
2023-04-06 19:14:32 +08:00
|
|
|
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
2022-03-02 14:49:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
QueryNodeNumCollections = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "collection_num",
|
|
|
|
Help: "number of collections loaded",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
2022-11-07 10:15:02 +08:00
|
|
|
QueryNodeConsumeTimeTickLag = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "consume_tt_lag_ms",
|
|
|
|
Help: "now time minus tt per physical channel",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
msgTypeLabelName,
|
|
|
|
collectionIDLabelName,
|
|
|
|
})
|
|
|
|
|
2023-07-21 15:30:59 +08:00
|
|
|
QueryNodeProcessCost = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2023-07-25 10:01:00 +08:00
|
|
|
Name: "process_insert_or_delete_latency",
|
2023-07-21 15:30:59 +08:00
|
|
|
Help: "process insert or delete cost in ms",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
msgTypeLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeWaitProcessingMsgCount = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "wait_processing_msg_count",
|
|
|
|
Help: "count of wait processing msg",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
msgTypeLabelName,
|
|
|
|
})
|
|
|
|
|
2022-11-07 10:15:02 +08:00
|
|
|
QueryNodeConsumerMsgCount = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "consume_msg_count",
|
|
|
|
Help: "count of consumed msg",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
msgTypeLabelName,
|
|
|
|
collectionIDLabelName,
|
|
|
|
})
|
|
|
|
|
2022-03-02 14:49:55 +08:00
|
|
|
QueryNodeNumPartitions = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "partition_num",
|
|
|
|
Help: "number of partitions loaded",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeNumSegments = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "segment_num",
|
2022-11-28 14:53:14 +08:00
|
|
|
Help: "number of segments loaded, clustered by its collection, partition, state and # of indexed fields",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-11-28 14:53:14 +08:00
|
|
|
collectionIDLabelName,
|
|
|
|
partitionIDLabelName,
|
|
|
|
segmentStateLabelName,
|
|
|
|
indexCountLabelName,
|
2023-12-07 14:34:35 +08:00
|
|
|
segmentLevelLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeNumDmlChannels = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "dml_vchannel_num",
|
|
|
|
Help: "number of dmlChannels watched",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeNumDeltaChannels = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "delta_vchannel_num",
|
|
|
|
Help: "number of deltaChannels watched",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSQCount = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sq_req_count",
|
|
|
|
Help: "count of search / query request",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-15 21:51:21 +08:00
|
|
|
queryTypeLabelName,
|
|
|
|
statusLabelName,
|
2023-07-06 08:46:26 +08:00
|
|
|
requestScope,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSQReqLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sq_req_latency",
|
|
|
|
Help: "latency of Search or query requests",
|
2022-03-03 16:05:57 +08:00
|
|
|
Buckets: buckets,
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-15 21:51:21 +08:00
|
|
|
queryTypeLabelName,
|
2022-11-10 11:51:03 +08:00
|
|
|
requestScope,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
2023-06-09 11:26:35 +08:00
|
|
|
QueryNodeSQLatencyWaitTSafe = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "sq_wait_tsafe_latency",
|
|
|
|
Help: "latency of search or query to wait for tsafe",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
})
|
|
|
|
|
2022-03-02 14:49:55 +08:00
|
|
|
QueryNodeSQLatencyInQueue = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-06-30 17:26:19 +08:00
|
|
|
Name: "sq_queue_latency",
|
2022-04-27 23:03:47 +08:00
|
|
|
Help: "latency of search or query in queue",
|
2022-03-03 16:05:57 +08:00
|
|
|
Buckets: buckets,
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-15 21:51:21 +08:00
|
|
|
queryTypeLabelName,
|
2024-04-10 10:55:17 +08:00
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
2023-07-03 18:24:25 +08:00
|
|
|
QueryNodeSQPerUserLatencyInQueue = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "sq_queue_user_latency",
|
|
|
|
Help: "latency per user of search or query in queue",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
usernameLabelName,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2022-03-02 14:49:55 +08:00
|
|
|
QueryNodeSQSegmentLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sq_segment_latency",
|
|
|
|
Help: "latency of search or query per segment",
|
2022-03-03 16:05:57 +08:00
|
|
|
Buckets: buckets,
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-15 21:51:21 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-03 16:05:57 +08:00
|
|
|
queryTypeLabelName,
|
2022-04-27 23:03:47 +08:00
|
|
|
segmentStateLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSQSegmentLatencyInCore = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sq_core_latency",
|
|
|
|
Help: "latency of search or query latency in segcore",
|
2022-03-03 16:05:57 +08:00
|
|
|
Buckets: buckets,
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-15 21:51:21 +08:00
|
|
|
queryTypeLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeReduceLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sq_reduce_latency",
|
|
|
|
Help: "latency of reduce search or query result",
|
2022-03-03 16:05:57 +08:00
|
|
|
Buckets: buckets,
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-04-27 23:03:47 +08:00
|
|
|
queryTypeLabelName,
|
2023-07-11 18:18:28 +08:00
|
|
|
reduceLevelName,
|
2024-05-06 20:29:30 +08:00
|
|
|
reduceType,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeLoadSegmentLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "load_segment_latency",
|
|
|
|
Help: "latency of load per segment",
|
2024-03-08 15:39:02 +08:00
|
|
|
Buckets: longTaskBuckets, // unit milliseconds
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
|
|
|
|
2022-06-02 16:06:03 +08:00
|
|
|
QueryNodeReadTaskUnsolveLen = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "read_task_unsolved_len",
|
|
|
|
Help: "number of unsolved read tasks in unsolvedQueue",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeReadTaskReadyLen = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "read_task_ready_len",
|
|
|
|
Help: "number of ready read tasks in readyQueue",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeReadTaskConcurrency = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "read_task_concurrency",
|
|
|
|
Help: "number of concurrent executing read tasks in QueryNode",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeEstimateCPUUsage = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "estimate_cpu_usage",
|
|
|
|
Help: "estimated cpu usage by the scheduler in QueryNode",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSearchGroupNQ = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "search_group_nq",
|
|
|
|
Help: "the number of queries of each grouped search task",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSearchNQ = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "search_nq",
|
|
|
|
Help: "the number of queries of each search task",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSearchGroupTopK = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "search_group_topk",
|
|
|
|
Help: "the topK of each grouped search task",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSearchTopK = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "search_topk",
|
|
|
|
Help: "the top of each search task",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeSearchGroupSize = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "search_group_size",
|
|
|
|
Help: "the number of tasks of each grouped search task",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
2024-06-10 21:34:08 +08:00
|
|
|
QueryNodeSegmentPruneRatio = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_prune_ratio",
|
|
|
|
Help: "latency of compaction operation",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
collectionIDLabelName,
|
|
|
|
isVectorFieldLabelName,
|
|
|
|
})
|
|
|
|
|
2022-06-02 16:06:03 +08:00
|
|
|
QueryNodeEvictedReadReqCount = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "read_evicted_count",
|
|
|
|
Help: "count of evicted search / query request",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
2022-03-02 14:49:55 +08:00
|
|
|
QueryNodeNumFlowGraphs = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "flowgraph_num",
|
|
|
|
Help: "number of flowgraphs",
|
2022-03-02 14:49:55 +08:00
|
|
|
}, []string{
|
2022-03-03 16:05:57 +08:00
|
|
|
nodeIDLabelName,
|
2022-03-02 14:49:55 +08:00
|
|
|
})
|
2022-06-02 16:06:03 +08:00
|
|
|
|
|
|
|
QueryNodeNumEntities = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
2022-06-30 17:26:19 +08:00
|
|
|
Name: "entity_num",
|
2022-11-28 14:53:14 +08:00
|
|
|
Help: "number of entities which can be searched/queried, clustered by collection, partition and state",
|
2022-06-02 16:06:03 +08:00
|
|
|
}, []string{
|
2024-04-02 14:27:13 +08:00
|
|
|
databaseLabelName,
|
2022-06-02 16:06:03 +08:00
|
|
|
nodeIDLabelName,
|
2022-11-28 14:53:14 +08:00
|
|
|
collectionIDLabelName,
|
|
|
|
partitionIDLabelName,
|
|
|
|
segmentStateLabelName,
|
2022-06-02 16:06:03 +08:00
|
|
|
})
|
2022-09-16 09:56:47 +08:00
|
|
|
|
2023-07-12 14:26:28 +08:00
|
|
|
QueryNodeEntitiesSize = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "entity_size",
|
|
|
|
Help: "entities' memory size, clustered by collection and state",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
collectionIDLabelName,
|
|
|
|
segmentStateLabelName,
|
|
|
|
})
|
|
|
|
|
2023-12-07 14:34:35 +08:00
|
|
|
QueryNodeLevelZeroSize = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "level_zero_size",
|
|
|
|
Help: "level zero segments' delete records memory size, clustered by collection and state",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
collectionIDLabelName,
|
|
|
|
channelNameLabelName,
|
|
|
|
})
|
|
|
|
|
2022-09-16 09:56:47 +08:00
|
|
|
// QueryNodeConsumeCounter counts the bytes QueryNode consumed from message storage.
|
|
|
|
QueryNodeConsumeCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "consume_bytes_counter",
|
|
|
|
Help: "",
|
|
|
|
}, []string{nodeIDLabelName, msgTypeLabelName})
|
|
|
|
|
|
|
|
// QueryNodeExecuteCounter counts the bytes of requests in QueryNode.
|
|
|
|
QueryNodeExecuteCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "execute_bytes_counter",
|
|
|
|
Help: "",
|
|
|
|
}, []string{nodeIDLabelName, msgTypeLabelName})
|
2023-02-16 14:58:34 +08:00
|
|
|
|
|
|
|
QueryNodeMsgDispatcherTtLag = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "msg_dispatcher_tt_lag_ms",
|
|
|
|
Help: "time.Now() sub dispatcher's current consume time",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
channelNameLabelName,
|
|
|
|
})
|
2023-06-26 17:52:44 +08:00
|
|
|
|
|
|
|
QueryNodeSegmentSearchLatencyPerVector = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_latency_per_vector",
|
|
|
|
Help: "one vector's search latency per segment",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
segmentStateLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeWatchDmlChannelLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "watch_dml_channel_latency",
|
|
|
|
Help: "latency of watch dml channel",
|
|
|
|
Buckets: buckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
2023-08-11 10:35:42 +08:00
|
|
|
|
|
|
|
QueryNodeDiskUsedSize = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_used_size",
|
|
|
|
Help: "disk used size(MB)",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
2023-12-21 10:14:52 +08:00
|
|
|
|
|
|
|
StoppingBalanceNodeNum = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "stopping_balance_node_num",
|
|
|
|
Help: "the number of node which executing stopping balance",
|
|
|
|
}, []string{})
|
|
|
|
|
|
|
|
StoppingBalanceChannelNum = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "stopping_balance_channel_num",
|
|
|
|
Help: "the number of channel which executing stopping balance",
|
|
|
|
}, []string{nodeIDLabelName})
|
|
|
|
|
|
|
|
StoppingBalanceSegmentNum = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "stopping_balance_segment_num",
|
|
|
|
Help: "the number of segment which executing stopping balance",
|
|
|
|
}, []string{nodeIDLabelName})
|
2024-03-08 15:39:02 +08:00
|
|
|
|
|
|
|
QueryNodeLoadSegmentConcurrency = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "load_segment_concurrency",
|
|
|
|
Help: "number of concurrent loading segments in QueryNode",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
loadTypeName,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeLoadIndexLatency = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "load_index_latency",
|
|
|
|
Help: "latency of load per segment's index, in milliseconds",
|
|
|
|
Buckets: longTaskBuckets, // unit milliseconds
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
2024-04-10 10:55:17 +08:00
|
|
|
|
|
|
|
// QueryNodeSegmentAccessTotal records the total number of search or query segments accessed.
|
|
|
|
QueryNodeSegmentAccessTotal = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_total",
|
|
|
|
Help: "number of segments accessed",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
// QueryNodeSegmentAccessDuration records the total time cost of accessing segments including cache loads.
|
|
|
|
QueryNodeSegmentAccessDuration = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_duration",
|
|
|
|
Help: "total time cost of accessing segments",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
// QueryNodeSegmentAccessGlobalDuration records the global time cost of accessing segments.
|
|
|
|
QueryNodeSegmentAccessGlobalDuration = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_global_duration",
|
|
|
|
Help: "global time cost of accessing segments",
|
|
|
|
Buckets: longTaskBuckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
// QueryNodeSegmentAccessWaitCacheTotal records the number of search or query segments that have to wait for loading access.
|
|
|
|
QueryNodeSegmentAccessWaitCacheTotal = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_wait_cache_total",
|
|
|
|
Help: "number of segments waiting for loading access",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeSegmentAccessWaitCacheDuration records the total time cost of waiting for loading access.
|
|
|
|
QueryNodeSegmentAccessWaitCacheDuration = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_wait_cache_duration",
|
|
|
|
Help: "total time cost of waiting for loading access",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeSegmentAccessWaitCacheGlobalDuration records the global time cost of waiting for loading access.
|
|
|
|
QueryNodeSegmentAccessWaitCacheGlobalDuration = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "segment_access_wait_cache_global_duration",
|
|
|
|
Help: "global time cost of waiting for loading access",
|
|
|
|
Buckets: longTaskBuckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
queryTypeLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheLoadTotal records the number of real segments loaded from disk cache.
|
|
|
|
QueryNodeDiskCacheLoadTotal = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Help: "number of segments loaded from disk cache",
|
|
|
|
Name: "disk_cache_load_total",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheLoadBytes records the number of bytes loaded from disk cache.
|
|
|
|
QueryNodeDiskCacheLoadBytes = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Help: "number of bytes loaded from disk cache",
|
|
|
|
Name: "disk_cache_load_bytes",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheLoadDuration records the total time cost of loading segments from disk cache.
|
|
|
|
// With db and resource group labels.
|
|
|
|
QueryNodeDiskCacheLoadDuration = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Help: "total time cost of loading segments from disk cache",
|
|
|
|
Name: "disk_cache_load_duration",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheLoadGlobalDuration records the global time cost of loading segments from disk cache.
|
|
|
|
QueryNodeDiskCacheLoadGlobalDuration = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_cache_load_global_duration",
|
|
|
|
Help: "global duration of loading segments from disk cache",
|
|
|
|
Buckets: longTaskBuckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheEvictTotal records the number of real segments evicted from disk cache.
|
|
|
|
QueryNodeDiskCacheEvictTotal = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_cache_evict_total",
|
|
|
|
Help: "number of segments evicted from disk cache",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheEvictBytes records the number of bytes evicted from disk cache.
|
|
|
|
QueryNodeDiskCacheEvictBytes = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_cache_evict_bytes",
|
|
|
|
Help: "number of bytes evicted from disk cache",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheEvictDuration records the total time cost of evicting segments from disk cache.
|
|
|
|
QueryNodeDiskCacheEvictDuration = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_cache_evict_duration",
|
|
|
|
Help: "total time cost of evicting segments from disk cache",
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
databaseLabelName,
|
|
|
|
resourceGroupLabelName,
|
|
|
|
})
|
|
|
|
|
|
|
|
// QueryNodeDiskCacheEvictGlobalDuration records the global time cost of evicting segments from disk cache.
|
|
|
|
QueryNodeDiskCacheEvictGlobalDuration = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.QueryNodeRole,
|
|
|
|
Name: "disk_cache_evict_global_duration",
|
|
|
|
Help: "global duration of evicting segments from disk cache",
|
|
|
|
Buckets: longTaskBuckets,
|
|
|
|
}, []string{
|
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
2022-03-02 14:49:55 +08:00
|
|
|
)
|
|
|
|
|
2022-11-28 14:53:14 +08:00
|
|
|
// RegisterQueryNode registers QueryNode metrics
|
2022-03-18 15:51:22 +08:00
|
|
|
func RegisterQueryNode(registry *prometheus.Registry) {
|
|
|
|
registry.MustRegister(QueryNodeNumCollections)
|
|
|
|
registry.MustRegister(QueryNodeNumPartitions)
|
|
|
|
registry.MustRegister(QueryNodeNumSegments)
|
|
|
|
registry.MustRegister(QueryNodeNumDmlChannels)
|
|
|
|
registry.MustRegister(QueryNodeNumDeltaChannels)
|
|
|
|
registry.MustRegister(QueryNodeSQCount)
|
|
|
|
registry.MustRegister(QueryNodeSQReqLatency)
|
2023-06-09 11:26:35 +08:00
|
|
|
registry.MustRegister(QueryNodeSQLatencyWaitTSafe)
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(QueryNodeSQLatencyInQueue)
|
2023-07-03 18:24:25 +08:00
|
|
|
registry.MustRegister(QueryNodeSQPerUserLatencyInQueue)
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(QueryNodeSQSegmentLatency)
|
|
|
|
registry.MustRegister(QueryNodeSQSegmentLatencyInCore)
|
|
|
|
registry.MustRegister(QueryNodeReduceLatency)
|
|
|
|
registry.MustRegister(QueryNodeLoadSegmentLatency)
|
2022-06-02 16:06:03 +08:00
|
|
|
registry.MustRegister(QueryNodeReadTaskUnsolveLen)
|
|
|
|
registry.MustRegister(QueryNodeReadTaskReadyLen)
|
|
|
|
registry.MustRegister(QueryNodeReadTaskConcurrency)
|
|
|
|
registry.MustRegister(QueryNodeEstimateCPUUsage)
|
|
|
|
registry.MustRegister(QueryNodeSearchGroupNQ)
|
|
|
|
registry.MustRegister(QueryNodeSearchNQ)
|
|
|
|
registry.MustRegister(QueryNodeSearchGroupSize)
|
|
|
|
registry.MustRegister(QueryNodeEvictedReadReqCount)
|
|
|
|
registry.MustRegister(QueryNodeSearchGroupTopK)
|
|
|
|
registry.MustRegister(QueryNodeSearchTopK)
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(QueryNodeNumFlowGraphs)
|
2022-06-02 16:06:03 +08:00
|
|
|
registry.MustRegister(QueryNodeNumEntities)
|
2023-07-12 14:26:28 +08:00
|
|
|
registry.MustRegister(QueryNodeEntitiesSize)
|
2023-12-07 14:34:35 +08:00
|
|
|
registry.MustRegister(QueryNodeLevelZeroSize)
|
2022-09-16 09:56:47 +08:00
|
|
|
registry.MustRegister(QueryNodeConsumeCounter)
|
|
|
|
registry.MustRegister(QueryNodeExecuteCounter)
|
2022-11-07 10:15:02 +08:00
|
|
|
registry.MustRegister(QueryNodeConsumerMsgCount)
|
|
|
|
registry.MustRegister(QueryNodeConsumeTimeTickLag)
|
2023-02-16 14:58:34 +08:00
|
|
|
registry.MustRegister(QueryNodeMsgDispatcherTtLag)
|
2023-06-26 17:52:44 +08:00
|
|
|
registry.MustRegister(QueryNodeSegmentSearchLatencyPerVector)
|
|
|
|
registry.MustRegister(QueryNodeWatchDmlChannelLatency)
|
2023-08-11 10:35:42 +08:00
|
|
|
registry.MustRegister(QueryNodeDiskUsedSize)
|
2023-07-25 10:01:00 +08:00
|
|
|
registry.MustRegister(QueryNodeProcessCost)
|
|
|
|
registry.MustRegister(QueryNodeWaitProcessingMsgCount)
|
2023-12-21 10:14:52 +08:00
|
|
|
registry.MustRegister(StoppingBalanceNodeNum)
|
|
|
|
registry.MustRegister(StoppingBalanceChannelNum)
|
|
|
|
registry.MustRegister(StoppingBalanceSegmentNum)
|
2024-03-08 15:39:02 +08:00
|
|
|
registry.MustRegister(QueryNodeLoadSegmentConcurrency)
|
|
|
|
registry.MustRegister(QueryNodeLoadIndexLatency)
|
2024-04-10 10:55:17 +08:00
|
|
|
registry.MustRegister(QueryNodeSegmentAccessTotal)
|
|
|
|
registry.MustRegister(QueryNodeSegmentAccessDuration)
|
|
|
|
registry.MustRegister(QueryNodeSegmentAccessGlobalDuration)
|
|
|
|
registry.MustRegister(QueryNodeSegmentAccessWaitCacheTotal)
|
|
|
|
registry.MustRegister(QueryNodeSegmentAccessWaitCacheDuration)
|
|
|
|
registry.MustRegister(QueryNodeSegmentAccessWaitCacheGlobalDuration)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheLoadTotal)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheLoadBytes)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheLoadDuration)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheLoadGlobalDuration)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheEvictTotal)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheEvictBytes)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheEvictDuration)
|
|
|
|
registry.MustRegister(QueryNodeDiskCacheEvictGlobalDuration)
|
2024-06-10 21:34:08 +08:00
|
|
|
registry.MustRegister(QueryNodeSegmentPruneRatio)
|
2022-11-07 10:15:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func CleanupQueryNodeCollectionMetrics(nodeID int64, collectionID int64) {
|
2024-05-07 15:41:29 +08:00
|
|
|
nodeIDLabel := fmt.Sprint(nodeID)
|
|
|
|
collectionIDLabel := fmt.Sprint(collectionID)
|
|
|
|
QueryNodeConsumerMsgCount.
|
|
|
|
DeletePartialMatch(
|
|
|
|
prometheus.Labels{
|
|
|
|
nodeIDLabelName: nodeIDLabel,
|
|
|
|
collectionIDLabelName: collectionIDLabel,
|
|
|
|
})
|
|
|
|
|
|
|
|
QueryNodeConsumeTimeTickLag.
|
|
|
|
DeletePartialMatch(
|
|
|
|
prometheus.Labels{
|
|
|
|
nodeIDLabelName: nodeIDLabel,
|
|
|
|
collectionIDLabelName: collectionIDLabel,
|
|
|
|
})
|
|
|
|
QueryNodeNumEntities.
|
|
|
|
DeletePartialMatch(
|
|
|
|
prometheus.Labels{
|
|
|
|
nodeIDLabelName: nodeIDLabel,
|
|
|
|
collectionIDLabelName: collectionIDLabel,
|
|
|
|
})
|
|
|
|
QueryNodeEntitiesSize.
|
|
|
|
DeletePartialMatch(
|
|
|
|
prometheus.Labels{
|
|
|
|
nodeIDLabelName: nodeIDLabel,
|
|
|
|
collectionIDLabelName: collectionIDLabel,
|
|
|
|
})
|
2022-03-02 14:49:55 +08:00
|
|
|
}
|