diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-09-18 00:09:04 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-09-18 00:09:04 -0700 |
| commit | 23e9ede068fdc4ffde6505f97a0100684fdcf142 (patch) | |
| tree | 0d8b9f5e80cf2d3cdd91b46342023ed93380f6fb /weed/stats/metrics.go | |
| parent | 852e5f7cbce6103874cb2b09e5e124276f298657 (diff) | |
| download | seaweedfs-23e9ede068fdc4ffde6505f97a0100684fdcf142.tar.xz seaweedfs-23e9ede068fdc4ffde6505f97a0100684fdcf142.zip | |
s3: collect metrics
Diffstat (limited to 'weed/stats/metrics.go')
| -rw-r--r-- | weed/stats/metrics.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go index fc47cebb0..25117ae72 100644 --- a/weed/stats/metrics.go +++ b/weed/stats/metrics.go @@ -91,6 +91,23 @@ 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() { @@ -107,6 +124,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) { |
