mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
[s3] reducing the number of metrics for 403 (#5961)
reducing the number of metrics
This commit is contained in:
parent
67a252ee8a
commit
16984ef07a
@ -16,10 +16,7 @@ func track(f http.HandlerFunc, action string) http.HandlerFunc {
|
|||||||
start := time.Now()
|
start := time.Now()
|
||||||
f(recorder, r)
|
f(recorder, r)
|
||||||
if recorder.Status == http.StatusForbidden {
|
if recorder.Status == http.StatusForbidden {
|
||||||
if m, _ := stats_collect.S3RequestCounter.GetMetricWithLabelValues(
|
bucket = ""
|
||||||
action, strconv.Itoa(http.StatusOK), bucket); m == nil {
|
|
||||||
bucket = ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stats_collect.S3RequestHistogram.WithLabelValues(action, bucket).Observe(time.Since(start).Seconds())
|
stats_collect.S3RequestHistogram.WithLabelValues(action, bucket).Observe(time.Since(start).Seconds())
|
||||||
stats_collect.S3RequestCounter.WithLabelValues(action, strconv.Itoa(recorder.Status), bucket).Inc()
|
stats_collect.S3RequestCounter.WithLabelValues(action, strconv.Itoa(recorder.Status), bucket).Inc()
|
||||||
|
Loading…
Reference in New Issue
Block a user