提交 61278633 编写于 作者: D Davies Liu

cleanup P8s metrics

上级 2c833f33
......@@ -45,23 +45,23 @@ import (
var (
cpu = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "juicefs_cpu_usage",
Name: "cpu_usage",
Help: "Accumulated CPU usage in seconds.",
})
memory = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "juicefs_memory",
Name: "memory",
Help: "Used memory in bytes.",
})
uptime = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "juicefs_uptime",
Name: "uptime",
Help: "Total running time in seconds.",
})
usedSpace = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "juicefs_used_space",
Name: "used_space",
Help: "Total used space in bytes.",
})
usedInodes = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "juicefs_used_inodes",
Name: "used_inodes",
Help: "Total number of inodes.",
})
)
......@@ -153,7 +153,8 @@ func mount(c *cli.Context) error {
"mp": mp,
}
// Wrap the default registry, all prometheus.MustRegister() calls should be afterwards
prometheus.DefaultRegisterer = prometheus.WrapRegistererWith(mntLabels, prometheus.DefaultRegisterer)
prometheus.DefaultRegisterer = prometheus.WrapRegistererWith(mntLabels,
prometheus.WrapRegistererWithPrefix("juicefs_", prometheus.DefaultRegisterer))
chunkConf := chunk.Config{
BlockSize: format.BlockSize * 1024,
......
......@@ -42,19 +42,19 @@ var (
logger = utils.GetLogger("juicefs")
cacheHits = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_blockcache_hits",
Name: "blockcache_hits",
Help: "read from cached block",
})
cacheMiss = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_blockcache_miss",
Name: "blockcache_miss",
Help: "missed read from cached block",
})
cacheHitBytes = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_blockcache_hit_bytes",
Name: "blockcache_hit_bytes",
Help: "read bytes from cached block",
})
cacheMissBytes = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_blockcache_miss_bytes",
Name: "blockcache_miss_bytes",
Help: "missed bytes from cached block",
})
)
......@@ -682,7 +682,7 @@ func NewCachedStore(storage object.ObjectStorage, config Config) ChunkStore {
_ = prometheus.Register(cacheMissBytes)
_ = prometheus.Register(prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Name: "juicefs_blockcache_blocks",
Name: "blockcache_blocks",
Help: "number of cached blocks",
},
func() float64 {
......@@ -691,7 +691,7 @@ func NewCachedStore(storage object.ObjectStorage, config Config) ChunkStore {
}))
_ = prometheus.Register(prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Name: "juicefs_blockcache_bytes",
Name: "blockcache_bytes",
Help: "number of cached bytes",
},
func() float64 {
......
......@@ -19,12 +19,12 @@ import "github.com/prometheus/client_golang/prometheus"
var (
redisTxDist = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "juicefs_redis_tx_durations_histogram_seconds",
Name: "redis_tx_durations_histogram_seconds",
Help: "Redis transactions latency distributions.",
Buckets: prometheus.ExponentialBuckets(0.0001, 1.5, 30),
})
redisTxRestart = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_redis_transaction_restart",
Name: "redis_transaction_restart",
Help: "The number of times a Redis transaction is restarted.",
})
)
......
......@@ -24,16 +24,16 @@ import (
var (
reqsHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "juicefs_object_request_durations_histogram_seconds",
Name: "object_request_durations_histogram_seconds",
Help: "Object requests latency distributions.",
Buckets: prometheus.ExponentialBuckets(0.01, 1.5, 20),
}, []string{"method"})
reqErrors = prometheus.NewCounter(prometheus.CounterOpts{
Name: "juicefs_object_request_errors",
Name: "object_request_errors",
Help: "failed requests to object store",
})
dataBytes = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "juicefs_object_request_data_bytes",
Name: "object_request_data_bytes",
Help: "Object requests size in bytes.",
}, []string{"method"})
)
......
......@@ -26,7 +26,7 @@ import (
var (
opsDurationsHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "juicefs_fuse_ops_durations_histogram_seconds",
Name: "fuse_ops_durations_histogram_seconds",
Help: "Operations latency distributions.",
Buckets: prometheus.ExponentialBuckets(0.0001, 1.5, 30),
})
......
......@@ -27,7 +27,7 @@ import (
var (
handlersGause = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Name: "juicefs_fuse_open_handlers",
Name: "fuse_open_handlers",
Help: "number of open files and directories.",
}, func() float64 {
hanleLock.Lock()
......
......@@ -54,12 +54,12 @@ var (
var (
readSizeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "juicefs_fuse_read_size_bytes",
Name: "fuse_read_size_bytes",
Help: "size of read distributions.",
Buckets: prometheus.LinearBuckets(4096, 4096, 32),
})
writtenSizeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "juicefs_fuse_written_size_bytes",
Name: "fuse_written_size_bytes",
Help: "size of write distributions.",
Buckets: prometheus.LinearBuckets(4096, 4096, 32),
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册