aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/metrics.go
diff options
context:
space:
mode:
authorHadi Zamani <130847170+hadizamani021@users.noreply.github.com>2025-01-26 09:25:06 +0330
committerGitHub <noreply@github.com>2025-01-25 21:55:06 -0800
commita2330f624b8f44776857c4d0c1ab8d05fb866759 (patch)
treed7eb70a788a4e9fa0a153777d815488ed2da2554 /weed/stats/metrics.go
parentbe15fee8e7a4623afca02933f6ed8092994e1dae (diff)
downloadseaweedfs-a2330f624b8f44776857c4d0c1ab8d05fb866759.tar.xz
seaweedfs-a2330f624b8f44776857c4d0c1ab8d05fb866759.zip
Add metrics for uploaded and deleted s3 objects (#6475)
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 045686479..f741aee10 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -335,6 +335,22 @@ var (
Name: "bucket_traffic_sent_bytes_total",
Help: "Total number of bytes sent from an S3 bucket to clients.",
}, []string{"bucket"})
+
+ S3DeletedObjectsCounter = prometheus.NewCounterVec(
+ prometheus.CounterOpts{
+ Namespace: Namespace,
+ Subsystem: "s3",
+ Name: "deleted_objects",
+ Help: "Number of objects deleted in each bucket.",
+ }, []string{"bucket"})
+
+ S3UploadedObjectsCounter = prometheus.NewCounterVec(
+ prometheus.CounterOpts{
+ Namespace: Namespace,
+ Subsystem: "s3",
+ Name: "uploaded_objects",
+ Help: "Number of objects uploaded in each bucket.",
+ }, []string{"bucket"})
)
func init() {
@@ -380,6 +396,8 @@ func init() {
Gather.MustRegister(S3TimeToFirstByteHistogram)
Gather.MustRegister(S3BucketTrafficReceivedBytesCounter)
Gather.MustRegister(S3BucketTrafficSentBytesCounter)
+ Gather.MustRegister(S3DeletedObjectsCounter)
+ Gather.MustRegister(S3UploadedObjectsCounter)
go bucketMetricTTLControl()
}