2022-03-02 21:11:57 +08:00
|
|
|
package metrics
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-04-27 23:03:47 +08:00
|
|
|
// RootCoordProxyCounter counts the num of registered proxy nodes
|
|
|
|
RootCoordProxyCounter = prometheus.NewGaugeVec(
|
2022-03-02 21:11:57 +08:00
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "proxy_num",
|
|
|
|
Help: "number of proxy nodes managered by rootcoord",
|
|
|
|
}, []string{})
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// for time tick
|
|
|
|
|
|
|
|
// RootCoordInsertChannelTimeTick counts the time tick num of insert channel in 24H
|
|
|
|
RootCoordInsertChannelTimeTick = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-11-07 10:15:02 +08:00
|
|
|
Name: "produce_tt_lag_ms",
|
|
|
|
Help: "now time minus tt per physical channel",
|
2022-06-30 17:26:19 +08:00
|
|
|
}, []string{channelNameLabelName})
|
2022-03-02 21:11:57 +08:00
|
|
|
|
2022-04-27 23:03:47 +08:00
|
|
|
RootCoordDDLReqCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
2022-03-02 21:11:57 +08:00
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "ddl_req_count",
|
|
|
|
Help: "count of DDL operations",
|
|
|
|
}, []string{functionLabelName, statusLabelName})
|
2022-03-02 21:11:57 +08:00
|
|
|
|
2022-04-27 23:03:47 +08:00
|
|
|
//RootCoordDDLReqLatency records the latency for read type of DDL operations.
|
|
|
|
RootCoordDDLReqLatency = prometheus.NewHistogramVec(
|
2022-03-02 21:11:57 +08:00
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "ddl_req_latency",
|
|
|
|
Help: "latency of each DDL operations",
|
2022-03-15 21:51:21 +08:00
|
|
|
}, []string{functionLabelName})
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
// RootCoordSyncTimeTickLatency records the latency of sync time tick.
|
|
|
|
RootCoordSyncTimeTickLatency = prometheus.NewHistogram(
|
|
|
|
prometheus.HistogramOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "sync_timetick_latency",
|
|
|
|
Help: "latency of synchronizing timetick message",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// RootCoordIDAllocCounter records the number of global ID allocations.
|
|
|
|
RootCoordIDAllocCounter = prometheus.NewCounter(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
|
|
|
Name: "id_alloc_count",
|
2022-04-27 23:03:47 +08:00
|
|
|
Help: "count of ID allocated",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
2022-04-27 23:03:47 +08:00
|
|
|
//RootCoordTimestamp records the number of timestamp allocations in RootCoord.
|
|
|
|
RootCoordTimestamp = prometheus.NewGauge(
|
2022-03-02 21:11:57 +08:00
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "timestamp",
|
|
|
|
Help: "lateste timestamp allocated in memory",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
2022-04-27 23:03:47 +08:00
|
|
|
// RootCoordTimestampSaved records the number of timestamp allocations in ETCD.
|
|
|
|
RootCoordTimestampSaved = prometheus.NewGauge(
|
2022-03-02 21:11:57 +08:00
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "timestamp_saved",
|
|
|
|
Help: "timestamp saved in meta storage",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// RootCoordNumOfCollections counts the number of collections.
|
|
|
|
RootCoordNumOfCollections = prometheus.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "collection_num",
|
|
|
|
Help: "number of collections",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// RootCoordNumOfPartitions counts the number of partitions per collection.
|
|
|
|
RootCoordNumOfPartitions = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "partition_num",
|
|
|
|
Help: "number of partitions",
|
2022-04-26 17:29:45 +08:00
|
|
|
}, []string{})
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
// RootCoordNumOfDMLChannel counts the number of DML channels.
|
|
|
|
RootCoordNumOfDMLChannel = prometheus.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "dml_channel_num",
|
|
|
|
Help: "number of DML channels",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// RootCoordNumOfMsgStream counts the number of message streams.
|
|
|
|
RootCoordNumOfMsgStream = prometheus.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-29 15:35:47 +08:00
|
|
|
Name: "msgstream_obj_num",
|
2022-04-27 23:03:47 +08:00
|
|
|
Help: "number of message streams",
|
2022-03-02 21:11:57 +08:00
|
|
|
})
|
2022-04-11 19:49:34 +08:00
|
|
|
|
|
|
|
// RootCoordNumOfCredentials counts the number of credentials.
|
|
|
|
RootCoordNumOfCredentials = prometheus.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
2022-04-27 23:03:47 +08:00
|
|
|
Name: "credential_num",
|
|
|
|
Help: "number of credentials",
|
2022-04-11 19:49:34 +08:00
|
|
|
})
|
2022-08-04 11:04:34 +08:00
|
|
|
|
|
|
|
// RootCoordNumOfRoles counts the number of credentials.
|
|
|
|
RootCoordNumOfRoles = prometheus.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
|
|
|
Name: "num_of_roles",
|
|
|
|
Help: "The number of roles",
|
|
|
|
})
|
2022-10-19 15:13:26 +08:00
|
|
|
|
|
|
|
// RootCoordTtDelay records the max time tick delay of flow graphs in DataNodes and QueryNodes.
|
|
|
|
RootCoordTtDelay = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Namespace: milvusNamespace,
|
|
|
|
Subsystem: typeutil.RootCoordRole,
|
|
|
|
Name: "time_tick_delay",
|
|
|
|
Help: "The max time tick delay of flow graphs",
|
|
|
|
}, []string{
|
2022-11-02 10:55:34 +08:00
|
|
|
roleNameLabelName,
|
2022-10-19 15:13:26 +08:00
|
|
|
nodeIDLabelName,
|
|
|
|
})
|
2022-03-02 21:11:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
//RegisterRootCoord registers RootCoord metrics
|
2022-03-18 15:51:22 +08:00
|
|
|
func RegisterRootCoord(registry *prometheus.Registry) {
|
2022-04-27 23:03:47 +08:00
|
|
|
registry.Register(RootCoordProxyCounter)
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
// for time tick
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(RootCoordInsertChannelTimeTick)
|
|
|
|
registry.MustRegister(RootCoordSyncTimeTickLatency)
|
2022-03-02 21:11:57 +08:00
|
|
|
|
2022-04-29 15:35:47 +08:00
|
|
|
// for DDL
|
|
|
|
registry.MustRegister(RootCoordDDLReqCounter)
|
2022-04-27 23:03:47 +08:00
|
|
|
registry.MustRegister(RootCoordDDLReqLatency)
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
// for allocator
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(RootCoordIDAllocCounter)
|
2022-04-27 23:03:47 +08:00
|
|
|
registry.MustRegister(RootCoordTimestamp)
|
|
|
|
registry.MustRegister(RootCoordTimestampSaved)
|
2022-03-02 21:11:57 +08:00
|
|
|
|
|
|
|
// for collection
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(RootCoordNumOfCollections)
|
|
|
|
registry.MustRegister(RootCoordNumOfPartitions)
|
2022-03-02 21:11:57 +08:00
|
|
|
|
2022-03-18 15:51:22 +08:00
|
|
|
registry.MustRegister(RootCoordNumOfDMLChannel)
|
|
|
|
registry.MustRegister(RootCoordNumOfMsgStream)
|
2022-04-11 19:49:34 +08:00
|
|
|
|
|
|
|
// for credential
|
|
|
|
registry.MustRegister(RootCoordNumOfCredentials)
|
2022-08-04 11:04:34 +08:00
|
|
|
|
|
|
|
registry.MustRegister(RootCoordNumOfRoles)
|
2022-10-19 15:13:26 +08:00
|
|
|
registry.MustRegister(RootCoordTtDelay)
|
2022-03-02 21:11:57 +08:00
|
|
|
}
|