Skip to content

Commit

Permalink
[s3] reducing the number of metrics for 403 (seaweedfs#5961)
Browse files Browse the repository at this point in the history
reducing the number of metrics
  • Loading branch information
kmlebedev committed Sep 4, 2024
1 parent 67a252e commit 16984ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions weed/s3api/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ func track(f http.HandlerFunc, action string) http.HandlerFunc {
start := time.Now()
f(recorder, r)
if recorder.Status == http.StatusForbidden {
if m, _ := stats_collect.S3RequestCounter.GetMetricWithLabelValues(
action, strconv.Itoa(http.StatusOK), bucket); m == nil {
bucket = ""
}
bucket = ""
}
stats_collect.S3RequestHistogram.WithLabelValues(action, bucket).Observe(time.Since(start).Seconds())
stats_collect.S3RequestCounter.WithLabelValues(action, strconv.Itoa(recorder.Status), bucket).Inc()
Expand Down

0 comments on commit 16984ef

Please sign in to comment.