aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/metrics.go
diff options
context:
space:
mode:
authorHadi Zamani <130847170+hadizamani021@users.noreply.github.com>2025-01-16 19:53:35 +0330
committerGitHub <noreply@github.com>2025-01-16 08:23:35 -0800
commitc7ae969c06476655bcb0268ca2fd8061bbd6e975 (patch)
treefc597a76c76db8c5f3caea1900684860f383f68d /weed/stats/metrics.go
parentaa299462f2c4ea857ee6997ec25eedd812904212 (diff)
downloadseaweedfs-c7ae969c06476655bcb0268ca2fd8061bbd6e975.tar.xz
seaweedfs-c7ae969c06476655bcb0268ca2fd8061bbd6e975.zip
Add bucket's traffic metrics (#6444)
* Add bucket's traffic metrics * Add bucket traffic to dashboards * Fix bucket metrics help messages * Fix variable names
Diffstat (limited to 'weed/stats/metrics.go')
-rw-r--r--weed/stats/metrics.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index 5e3ed4370..045686479 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -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()
}