aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/stats.go
diff options
context:
space:
mode:
authorsteve.wei <coderushing@gmail.com>2024-10-15 03:10:05 +0800
committerGitHub <noreply@github.com>2024-10-14 12:10:05 -0700
commitcfbe45c7658350e2b8f636d093a2bbe2028f8521 (patch)
treea7e636b3e61fa1e8b204fa687bc613aaa62046ab /weed/s3api/stats.go
parenta1f06c391cbea9b61f6cff8c3db224e466c06351 (diff)
downloadseaweedfs-cfbe45c7658350e2b8f636d093a2bbe2028f8521.tar.xz
seaweedfs-cfbe45c7658350e2b8f636d093a2bbe2028f8521.zip
feat: add in-flight metric for s3/file/volume-server (#6120)
Diffstat (limited to 'weed/s3api/stats.go')
-rw-r--r--weed/s3api/stats.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/s3api/stats.go b/weed/s3api/stats.go
index cd04b9970..415ec55dd 100644
--- a/weed/s3api/stats.go
+++ b/weed/s3api/stats.go
@@ -11,6 +11,10 @@ import (
func track(f http.HandlerFunc, action string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
+ inFlightGauge := stats_collect.S3InFlightRequestsGauge.WithLabelValues(action)
+ inFlightGauge.Inc()
+ defer inFlightGauge.Dec()
+
bucket, _ := s3_constants.GetBucketAndObject(r)
w.Header().Set("Server", "SeaweedFS "+util.VERSION)
recorder := stats_collect.NewStatusResponseWriter(w)