Add bucket's traffic metrics (#6444)

* Add bucket's traffic metrics

* Add bucket traffic to dashboards

* Fix bucket metrics help messages

* Fix variable names
This commit is contained in:
Hadi Zamani
2025-01-16 19:53:35 +03:30
committed by GitHub
parent aa299462f2
commit c7ae969c06
8 changed files with 715 additions and 64 deletions

View File

@@ -35,3 +35,8 @@ func TimeToFirstByte(action string, start time.Time, r *http.Request) {
stats_collect.S3TimeToFirstByteHistogram.WithLabelValues(action, bucket).Observe(float64(time.Since(start).Milliseconds()))
stats_collect.RecordBucketActiveTime(bucket)
}
func BucketTrafficSent(bytesTransferred int64, r *http.Request) {
bucket, _ := s3_constants.GetBucketAndObject(r)
stats_collect.S3BucketTrafficSentBytesCounter.WithLabelValues(bucket).Add(float64(bytesTransferred))
}