aboutsummaryrefslogtreecommitdiff
path: root/weed/stats
diff options
context:
space:
mode:
Diffstat (limited to 'weed/stats')
-rw-r--r--weed/stats/metrics.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index f3824728e..29e7c8edf 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -15,6 +15,7 @@ import (
var (
FilerGather = prometheus.NewRegistry()
VolumeServerGather = prometheus.NewRegistry()
+ S3Gather = prometheus.NewRegistry()
FilerRequestCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
@@ -90,6 +91,22 @@ var (
Name: "total_disk_size",
Help: "Actual disk size used by volumes.",
}, []string{"collection", "type"})
+
+ S3RequestCounter = prometheus.NewCounterVec(
+ prometheus.CounterOpts{
+ Namespace: "SeaweedFS",
+ Subsystem: "s3",
+ Name: "request_total",
+ Help: "Counter of s3 requests.",
+ }, []string{"type"})
+ S3RequestHistogram = prometheus.NewHistogramVec(
+ prometheus.HistogramOpts{
+ Namespace: "SeaweedFS",
+ Subsystem: "s3",
+ Name: "request_seconds",
+ Help: "Bucketed histogram of s3 request processing time.",
+ Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24),
+ }, []string{"type"})
)
func init() {
@@ -106,6 +123,8 @@ func init() {
VolumeServerGather.MustRegister(VolumeServerMaxVolumeCounter)
VolumeServerGather.MustRegister(VolumeServerDiskSizeGauge)
+ S3Gather.MustRegister(S3RequestCounter)
+ S3Gather.MustRegister(S3RequestHistogram)
}
func LoopPushingMetric(name, instance string, gatherer *prometheus.Registry, addr string, intervalSeconds int) {
@@ -114,6 +133,8 @@ func LoopPushingMetric(name, instance string, gatherer *prometheus.Registry, add
return
}
+ glog.V(0).Infof("%s server sends metrics to %s every %d seconds", name, addr, intervalSeconds)
+
pusher := push.New(addr, name).Gatherer(gatherer).Grouping("instance", instance)
for {