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

reducing the number of metrics
This commit is contained in:
Konstantin Lebedev 2024-09-04 23:06:54 +05:00 committed by GitHub
parent 67a252ee8a
commit 16984ef07a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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