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

@@ -319,6 +319,22 @@ var (
Name: "in_flight_requests",
Help: "Current number of in-flight requests being handled by s3.",
}, []string{"type"})
S3BucketTrafficReceivedBytesCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: Namespace,
Subsystem: "s3",
Name: "bucket_traffic_received_bytes_total",
Help: "Total number of bytes received by an S3 bucket from clients.",
}, []string{"bucket"})
S3BucketTrafficSentBytesCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: Namespace,
Subsystem: "s3",
Name: "bucket_traffic_sent_bytes_total",
Help: "Total number of bytes sent from an S3 bucket to clients.",
}, []string{"bucket"})
)
func init() {
@@ -362,6 +378,8 @@ func init() {
Gather.MustRegister(S3RequestHistogram)
Gather.MustRegister(S3InFlightRequestsGauge)
Gather.MustRegister(S3TimeToFirstByteHistogram)
Gather.MustRegister(S3BucketTrafficReceivedBytesCounter)
Gather.MustRegister(S3BucketTrafficSentBytesCounter)
go bucketMetricTTLControl()
}