Browse Source

[s3] reducing the number of metrics for 403 (#5961)

reducing the number of metrics
pull/5976/head
Konstantin Lebedev 4 months ago
committed by GitHub
parent
commit
16984ef07a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      weed/s3api/stats.go

3
weed/s3api/stats.go

@ -16,11 +16,8 @@ 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 = ""
}
}
stats_collect.S3RequestHistogram.WithLabelValues(action, bucket).Observe(time.Since(start).Seconds())
stats_collect.S3RequestCounter.WithLabelValues(action, strconv.Itoa(recorder.Status), bucket).Inc()
}

Loading…
Cancel
Save