feat: add in-flight metric for s3/file/volume-server (#6120)

This commit is contained in:
steve.wei
2024-10-15 03:10:05 +08:00
committed by GitHub
parent a1f06c391c
commit cfbe45c765
5 changed files with 49 additions and 0 deletions

View File

@@ -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)