mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 04:19:18 +08:00
32 lines
736 B
Go
32 lines
736 B
Go
|
package metrics
|
||
|
|
||
|
import (
|
||
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
EtcdPutKvSize = prometheus.NewHistogram(
|
||
|
prometheus.HistogramOpts{
|
||
|
Namespace: milvusNamespace,
|
||
|
Subsystem: "etcd",
|
||
|
Name: "etcd_kv_size",
|
||
|
Help: "kv size stats",
|
||
|
Buckets: buckets,
|
||
|
})
|
||
|
|
||
|
EtcdRequestLatency = prometheus.NewHistogram(
|
||
|
prometheus.HistogramOpts{
|
||
|
Namespace: milvusNamespace,
|
||
|
Subsystem: "etcd",
|
||
|
Name: "client_request_latency",
|
||
|
Help: "request latency on the client side ",
|
||
|
Buckets: buckets,
|
||
|
})
|
||
|
)
|
||
|
|
||
|
//RegisterEtcdMetrics registers etcd metrics
|
||
|
func RegisterEtcdMetrics(registry *prometheus.Registry) {
|
||
|
registry.MustRegister(EtcdPutKvSize)
|
||
|
registry.MustRegister(EtcdRequestLatency)
|
||
|
}
|