2021-11-03 19:27:24 +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.
|
|
|
|
|
2021-05-21 21:48:04 +08:00
|
|
|
package metrics
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2021-12-23 11:39:10 +08:00
|
|
|
// nolint:gosec
|
|
|
|
_ "net/http/pprof"
|
|
|
|
|
2021-05-21 21:48:04 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/log"
|
2021-12-13 10:31:17 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
|
|
|
|
2021-06-01 11:04:31 +08:00
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
2021-05-21 21:48:04 +08:00
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2021-06-01 16:10:32 +08:00
|
|
|
const (
|
2021-12-13 10:31:17 +08:00
|
|
|
milvusNamespace = "milvus"
|
2021-06-01 16:10:32 +08:00
|
|
|
)
|
|
|
|
|
2021-06-01 11:04:31 +08:00
|
|
|
var (
|
2021-10-08 13:17:14 +08:00
|
|
|
// RootCoordProxyLister counts the num of registered proxy nodes
|
2021-06-22 19:08:03 +08:00
|
|
|
RootCoordProxyLister = prometheus.NewGaugeVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.GaugeOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-22 19:08:03 +08:00
|
|
|
Name: "list_of_proxy",
|
2021-10-08 13:17:14 +08:00
|
|
|
Help: "List of proxy nodes which have registered with etcd",
|
2021-06-01 11:04:31 +08:00
|
|
|
}, []string{"client_id"})
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// for grpc
|
|
|
|
|
2021-10-08 13:17:14 +08:00
|
|
|
// RootCoordCreateCollectionCounter counts the num of calls of CreateCollection
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordCreateCollectionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "create_collection_total",
|
|
|
|
Help: "Counter of create collection",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDropCollectionCounter counts the num of calls of DropCollection
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDropCollectionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "drop_collection_total",
|
|
|
|
Help: "Counter of drop collection",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordHasCollectionCounter counts the num of calls of HasCollection
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordHasCollectionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "has_collection_total",
|
|
|
|
Help: "Counter of has collection",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDescribeCollectionCounter counts the num of calls of DescribeCollection
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDescribeCollectionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "describe_collection_total",
|
|
|
|
Help: "Counter of describe collection",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordShowCollectionsCounter counts the num of calls of ShowCollections
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordShowCollectionsCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "show_collections_total",
|
|
|
|
Help: "Counter of show collections",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordCreatePartitionCounter counts the num of calls of CreatePartition
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordCreatePartitionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "create_partition_total",
|
|
|
|
Help: "Counter of create partition",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDropPartitionCounter counts the num of calls of DropPartition
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDropPartitionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "drop_partition_total",
|
|
|
|
Help: "Counter of drop partition",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordHasPartitionCounter counts the num of calls of HasPartition
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordHasPartitionCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "has_partition_total",
|
|
|
|
Help: "Counter of has partition",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordShowPartitionsCounter counts the num of calls of ShowPartitions
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordShowPartitionsCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "show_partitions_total",
|
|
|
|
Help: "Counter of show partitions",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordCreateIndexCounter counts the num of calls of CreateIndex
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordCreateIndexCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "create_index_total",
|
|
|
|
Help: "Counter of create index",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDropIndexCounter counts the num of calls of DropIndex
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDropIndexCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "drop_index_total",
|
|
|
|
Help: "Counter of drop index",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDescribeIndexCounter counts the num of calls of DescribeIndex
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDescribeIndexCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "describe_index_total",
|
|
|
|
Help: "Counter of describe index",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordDescribeSegmentCounter counts the num of calls of DescribeSegment
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDescribeSegmentCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "describe_segment_total",
|
|
|
|
Help: "Counter of describe segment",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
2021-10-22 16:19:20 +08:00
|
|
|
// RootCoordShowSegmentsCounter counts the num of calls of ShowSegments
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordShowSegmentsCounter = prometheus.NewCounterVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.CounterOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "show_segments_total",
|
|
|
|
Help: "Counter of show segments",
|
|
|
|
}, []string{"client_id", "type"})
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// for time tick
|
|
|
|
|
2021-10-23 18:15:12 +08:00
|
|
|
// RootCoordInsertChannelTimeTick counts the time tick num of insert channel in 24H
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordInsertChannelTimeTick = prometheus.NewGaugeVec(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.GaugeOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "insert_channel_time_tick",
|
|
|
|
Help: "Time tick of insert Channel in 24H",
|
|
|
|
}, []string{"vchannel"})
|
|
|
|
|
2021-10-23 18:15:12 +08:00
|
|
|
// RootCoordDDChannelTimeTick counts the time tick num of dd channel in 24H
|
2021-06-17 16:47:57 +08:00
|
|
|
RootCoordDDChannelTimeTick = prometheus.NewGauge(
|
2021-06-01 11:04:31 +08:00
|
|
|
prometheus.GaugeOpts{
|
2021-06-17 16:47:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2021-06-01 11:04:31 +08:00
|
|
|
Name: "dd_channel_time_tick",
|
|
|
|
Help: "Time tick of dd Channel in 24H",
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
2021-10-23 18:15:12 +08:00
|
|
|
//RegisterRootCoord registers RootCoord metrics
|
2021-06-17 16:47:57 +08:00
|
|
|
func RegisterRootCoord() {
|
2021-06-22 19:08:03 +08:00
|
|
|
prometheus.MustRegister(RootCoordProxyLister)
|
2021-06-01 11:04:31 +08:00
|
|
|
|
|
|
|
// for grpc
|
2021-06-17 16:47:57 +08:00
|
|
|
prometheus.MustRegister(RootCoordCreateCollectionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDropCollectionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordHasCollectionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDescribeCollectionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordShowCollectionsCounter)
|
|
|
|
prometheus.MustRegister(RootCoordCreatePartitionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDropPartitionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordHasPartitionCounter)
|
|
|
|
prometheus.MustRegister(RootCoordShowPartitionsCounter)
|
|
|
|
prometheus.MustRegister(RootCoordCreateIndexCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDropIndexCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDescribeIndexCounter)
|
|
|
|
prometheus.MustRegister(RootCoordDescribeSegmentCounter)
|
|
|
|
prometheus.MustRegister(RootCoordShowSegmentsCounter)
|
2021-06-01 11:04:31 +08:00
|
|
|
|
|
|
|
// for time tick
|
2021-06-17 16:47:57 +08:00
|
|
|
prometheus.MustRegister(RootCoordInsertChannelTimeTick)
|
|
|
|
prometheus.MustRegister(RootCoordDDChannelTimeTick)
|
2021-05-21 21:48:04 +08:00
|
|
|
//prometheus.MustRegister(PanicCounter)
|
|
|
|
}
|
|
|
|
|
2021-06-22 18:32:08 +08:00
|
|
|
var (
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyCreateCollectionCounter counts the num of calls of CreateCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyCreateCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "create_collection_total",
|
|
|
|
Help: "Counter of create collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDropCollectionCounter counts the num of calls of DropCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDropCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "drop_collection_total",
|
|
|
|
Help: "Counter of drop collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyHasCollectionCounter counts the num of calls of HasCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyHasCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "has_collection_total",
|
|
|
|
Help: "Counter of has collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyLoadCollectionCounter counts the num of calls of LoadCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyLoadCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "load_collection_total",
|
|
|
|
Help: "Counter of load collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyReleaseCollectionCounter counts the num of calls of ReleaseCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyReleaseCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "release_collection_total",
|
|
|
|
Help: "Counter of release collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDescribeCollectionCounter counts the num of calls of DescribeCollection
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDescribeCollectionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "describe_collection_total",
|
|
|
|
Help: "Counter of describe collection",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetCollectionStatisticsCounter counts the num of calls of GetCollectionStatistics
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetCollectionStatisticsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_collection_statistics_total",
|
|
|
|
Help: "Counter of get collection statistics",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyShowCollectionsCounter counts the num of calls of ShowCollections
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyShowCollectionsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "show_collections_total",
|
|
|
|
Help: "Counter of show collections",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyCreatePartitionCounter counts the num of calls of CreatePartition
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyCreatePartitionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "create_partition_total",
|
|
|
|
Help: "Counter of create partition",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDropPartitionCounter counts the num of calls of DropPartition
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDropPartitionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "drop_partition_total",
|
|
|
|
Help: "Counter of drop partition",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyHasPartitionCounter counts the num of calls of HasPartition
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyHasPartitionCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "has_partition_total",
|
|
|
|
Help: "Counter of has partition",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyLoadPartitionsCounter counts the num of calls of LoadPartitions
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyLoadPartitionsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "load_partitions_total",
|
|
|
|
Help: "Counter of load partitions",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyReleasePartitionsCounter counts the num of calls of ReleasePartitions
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyReleasePartitionsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "release_partitions_total",
|
|
|
|
Help: "Counter of release partitions",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetPartitionStatisticsCounter counts the num of calls of GetPartitionStatistics
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetPartitionStatisticsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_partition_statistics_total",
|
|
|
|
Help: "Counter of get partition statistics",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyShowPartitionsCounter counts the num of calls of ShowPartitions
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyShowPartitionsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "show_partitions_total",
|
|
|
|
Help: "Counter of show partitions",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyCreateIndexCounter counts the num of calls of CreateIndex
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyCreateIndexCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "create_index_counter",
|
|
|
|
Help: "Counter of create index",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDescribeIndexCounter counts the num of calls of DescribeIndex
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDescribeIndexCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "describe_index_counter",
|
|
|
|
Help: "Counter of describe index",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetIndexStateCounter counts the num of calls of GetIndexState
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetIndexStateCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_index_state_counter",
|
|
|
|
Help: "Counter of get index state",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetIndexBuildProgressCounter counts the num of calls of GetIndexBuildProgress
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetIndexBuildProgressCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_index_build_progress_total",
|
|
|
|
Help: "Counter of get index build progress",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDropIndexCounter counts the num of calls of DropIndex
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDropIndexCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "drop_index_total",
|
|
|
|
Help: "Counter of drop index",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyInsertCounter counts the num of calls of Insert
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyInsertCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "insert_total",
|
|
|
|
Help: "Counter of insert",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxySearchCounter counts the num of calls of Search
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxySearchCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "search_total",
|
|
|
|
Help: "Counter of search",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyRetrieveCounter counts the num of calls of Retrieve
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyRetrieveCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "retrieve_total",
|
|
|
|
Help: "Counter of retrieve",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyFlushCounter counts the num of calls of Flush
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyFlushCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "flush_total",
|
|
|
|
Help: "Counter of flush",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyQueryCounter counts the num of calls of Query
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyQueryCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "query_total",
|
|
|
|
Help: "Counter of query",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetPersistentSegmentInfoCounter counts the num of calls of GetPersistentSegmentInfo
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetPersistentSegmentInfoCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_persistent_segment_info_total",
|
|
|
|
Help: "Counter of get persistent segment info",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetQuerySegmentInfoCounter counts the num of calls of GetQuerySegmentInfo
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetQuerySegmentInfoCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_query_segment_info_total",
|
|
|
|
Help: "Counter of get query segment info",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDummyCounter counts the num of calls of Dummy
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyDummyCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "dummy_total",
|
|
|
|
Help: "Counter of dummy",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyRegisterLinkCounter counts the num of calls of RegisterLink
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyRegisterLinkCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "register_link_total",
|
|
|
|
Help: "Counter of register link",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetComponentStatesCounter counts the num of calls of GetComponentStates
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetComponentStatesCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_component_states_total",
|
|
|
|
Help: "Counter of get component states",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetStatisticsChannelCounter counts the num of calls of GetStatisticsChannel
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetStatisticsChannelCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_statistics_channel_total",
|
|
|
|
Help: "Counter of get statistics channel",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyInvalidateCollectionMetaCacheCounter counts the num of calls of InvalidateCollectionMetaCache
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyInvalidateCollectionMetaCacheCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "invalidate_collection_meta_cache_total",
|
|
|
|
Help: "Counter of invalidate collection meta cache",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyGetDdChannelCounter counts the num of calls of GetDdChannel
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyGetDdChannelCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "get_dd_channel_total",
|
|
|
|
Help: "Counter of get dd channel",
|
|
|
|
}, []string{"status"})
|
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyReleaseDQLMessageStreamCounter counts the num of calls of ReleaseDQLMessageStream
|
2021-06-22 18:32:08 +08:00
|
|
|
ProxyReleaseDQLMessageStreamCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-06-22 18:32:08 +08:00
|
|
|
Name: "release_dql_message_stream_total",
|
|
|
|
Help: "Counter of release dql message stream",
|
|
|
|
}, []string{"status"})
|
2021-07-21 11:26:11 +08:00
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
// ProxyDmlChannelTimeTick counts the time tick value of dml channels
|
2021-07-21 11:26:11 +08:00
|
|
|
ProxyDmlChannelTimeTick = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.ProxyRole,
|
2021-07-21 11:26:11 +08:00
|
|
|
Name: "dml_channels_time_tick",
|
|
|
|
Help: "Time tick of dml channels",
|
|
|
|
}, []string{"pchan"})
|
2021-06-22 18:32:08 +08:00
|
|
|
)
|
2021-05-21 21:48:04 +08:00
|
|
|
|
2021-11-02 19:43:22 +08:00
|
|
|
//RegisterProxy registers Proxy metrics
|
2021-06-22 18:32:08 +08:00
|
|
|
func RegisterProxy() {
|
|
|
|
prometheus.MustRegister(ProxyCreateCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyDropCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyHasCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyLoadCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyReleaseCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyDescribeCollectionCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetCollectionStatisticsCounter)
|
|
|
|
prometheus.MustRegister(ProxyShowCollectionsCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyCreatePartitionCounter)
|
|
|
|
prometheus.MustRegister(ProxyDropPartitionCounter)
|
|
|
|
prometheus.MustRegister(ProxyHasPartitionCounter)
|
|
|
|
prometheus.MustRegister(ProxyLoadPartitionsCounter)
|
|
|
|
prometheus.MustRegister(ProxyReleasePartitionsCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetPartitionStatisticsCounter)
|
|
|
|
prometheus.MustRegister(ProxyShowPartitionsCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyCreateIndexCounter)
|
|
|
|
prometheus.MustRegister(ProxyDescribeIndexCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetIndexStateCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetIndexBuildProgressCounter)
|
|
|
|
prometheus.MustRegister(ProxyDropIndexCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyInsertCounter)
|
|
|
|
prometheus.MustRegister(ProxySearchCounter)
|
|
|
|
prometheus.MustRegister(ProxyRetrieveCounter)
|
|
|
|
prometheus.MustRegister(ProxyFlushCounter)
|
|
|
|
prometheus.MustRegister(ProxyQueryCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyGetPersistentSegmentInfoCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetQuerySegmentInfoCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyDummyCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyRegisterLinkCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyGetComponentStatesCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetStatisticsChannelCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyInvalidateCollectionMetaCacheCounter)
|
|
|
|
prometheus.MustRegister(ProxyGetDdChannelCounter)
|
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyReleaseDQLMessageStreamCounter)
|
2021-07-21 11:26:11 +08:00
|
|
|
|
|
|
|
prometheus.MustRegister(ProxyDmlChannelTimeTick)
|
2021-05-21 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterQueryCoord registers QueryCoord metrics
|
2021-06-17 16:47:57 +08:00
|
|
|
func RegisterQueryCoord() {
|
2021-05-21 21:48:04 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterQueryNode registers QueryNode metrics
|
2021-05-21 21:48:04 +08:00
|
|
|
func RegisterQueryNode() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-06-01 16:10:32 +08:00
|
|
|
var (
|
2021-06-17 16:47:57 +08:00
|
|
|
//DataCoordDataNodeList records the num of regsitered data nodes
|
|
|
|
DataCoordDataNodeList = prometheus.NewGaugeVec(
|
2021-06-01 16:10:32 +08:00
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.DataCoordRole,
|
2021-06-01 16:10:32 +08:00
|
|
|
Name: "list_of_data_node",
|
2021-06-22 18:32:08 +08:00
|
|
|
Help: "List of data nodes registered within etcd",
|
2021-06-01 16:10:32 +08:00
|
|
|
}, []string{"status"},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterDataCoord registers DataCoord metrics
|
2021-06-17 16:47:57 +08:00
|
|
|
func RegisterDataCoord() {
|
2021-09-18 14:45:50 +08:00
|
|
|
prometheus.MustRegister(DataCoordDataNodeList)
|
2021-05-21 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2021-06-21 18:08:15 +08:00
|
|
|
var (
|
2021-11-30 19:41:50 +08:00
|
|
|
// DataNodeFlushSegmentsCounter counts the num of calls of FlushSegments
|
2021-06-21 18:08:15 +08:00
|
|
|
DataNodeFlushSegmentsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.DataNodeRole,
|
2021-06-21 18:08:15 +08:00
|
|
|
Name: "flush_segments_total",
|
|
|
|
Help: "Counter of flush segments",
|
|
|
|
}, []string{"type"})
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
// DataNodeWatchDmChannelsCounter counts the num of calls of WatchDmChannels
|
2021-06-21 18:08:15 +08:00
|
|
|
DataNodeWatchDmChannelsCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
2021-12-13 10:31:17 +08:00
|
|
|
Subsystem: typeutil.DataNodeRole,
|
2021-06-21 18:08:15 +08:00
|
|
|
Name: "watch_dm_channels_total",
|
|
|
|
Help: "Counter of watch dm channel",
|
|
|
|
}, []string{"type"})
|
|
|
|
)
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterDataNode registers DataNode metrics
|
2021-05-21 21:48:04 +08:00
|
|
|
func RegisterDataNode() {
|
2021-09-18 14:45:50 +08:00
|
|
|
prometheus.MustRegister(DataNodeFlushSegmentsCounter)
|
|
|
|
prometheus.MustRegister(DataNodeWatchDmChannelsCounter)
|
2021-05-21 21:48:04 +08:00
|
|
|
}
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterIndexCoord registers IndexCoord metrics
|
2021-06-17 16:47:57 +08:00
|
|
|
func RegisterIndexCoord() {
|
2021-05-21 21:48:04 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//RegisterIndexNode registers IndexNode metrics
|
2021-05-21 21:48:04 +08:00
|
|
|
func RegisterIndexNode() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-30 19:41:50 +08:00
|
|
|
//ServeHTTP serves prometheus http service
|
2021-05-21 21:48:04 +08:00
|
|
|
func ServeHTTP() {
|
|
|
|
http.Handle("/metrics", promhttp.Handler())
|
|
|
|
go func() {
|
|
|
|
if err := http.ListenAndServe(":9091", nil); err != nil {
|
|
|
|
log.Error("handle metrics failed", zap.Error(err))
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|