aboutsummaryrefslogtreecommitdiff
path: root/weed/server/filer_server_handlers.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-11-26 15:51:38 -0800
committerGitHub <noreply@github.com>2025-11-26 15:51:38 -0800
commit848bec6d245591d133050237e2109d7c1f686b1e (patch)
treef05614256b813e1fb0986a9878d276b5f867e7d6 /weed/server/filer_server_handlers.go
parent5287d9f3e32000c7a4b8c19ea7cd28bc5d1cd60e (diff)
downloadseaweedfs-848bec6d245591d133050237e2109d7c1f686b1e.tar.xz
seaweedfs-848bec6d245591d133050237e2109d7c1f686b1e.zip
Metrics: Add Prometheus metrics for concurrent upload tracking (#7555)
* metrics: add Prometheus metrics for concurrent upload tracking Add Prometheus metrics to monitor concurrent upload activity for both filer and S3 servers. This provides visibility into the upload limiting feature added in the previous PR. New Metrics: - SeaweedFS_filer_in_flight_upload_bytes: Current bytes being uploaded to filer - SeaweedFS_filer_in_flight_upload_count: Current number of uploads to filer - SeaweedFS_s3_in_flight_upload_bytes: Current bytes being uploaded to S3 - SeaweedFS_s3_in_flight_upload_count: Current number of uploads to S3 The metrics are updated atomically whenever uploads start or complete, providing real-time visibility into upload concurrency levels. This helps operators: - Monitor upload concurrency in real-time - Set appropriate limits based on actual usage patterns - Detect potential bottlenecks or capacity issues - Track the effectiveness of upload limiting configuration * grafana: add dashboard panels for concurrent upload metrics Add 4 new panels to the Grafana dashboard to visualize the concurrent upload metrics added in this PR: Filer Section: - Filer Concurrent Uploads: Shows current number of concurrent uploads - Filer Concurrent Upload Bytes: Shows current bytes being uploaded S3 Gateway Section: - S3 Concurrent Uploads: Shows current number of concurrent uploads - S3 Concurrent Upload Bytes: Shows current bytes being uploaded These panels help operators monitor upload concurrency in real-time and tune the upload limiting configuration based on actual usage patterns. * more efficient
Diffstat (limited to 'weed/server/filer_server_handlers.go')
-rw-r--r--weed/server/filer_server_handlers.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/weed/server/filer_server_handlers.go b/weed/server/filer_server_handlers.go
index a2eab9365..f068579ec 100644
--- a/weed/server/filer_server_handlers.go
+++ b/weed/server/filer_server_handlers.go
@@ -112,12 +112,18 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
fs.inFlightDataLimitCond.L.Unlock()
// Increment counters
- atomic.AddInt64(&fs.inFlightUploads, 1)
- atomic.AddInt64(&fs.inFlightDataSize, contentLength)
+ newUploads := atomic.AddInt64(&fs.inFlightUploads, 1)
+ newSize := atomic.AddInt64(&fs.inFlightDataSize, contentLength)
+ // Update metrics
+ stats.FilerInFlightUploadCountGauge.Set(float64(newUploads))
+ stats.FilerInFlightUploadBytesGauge.Set(float64(newSize))
defer func() {
// Decrement counters
- atomic.AddInt64(&fs.inFlightUploads, -1)
- atomic.AddInt64(&fs.inFlightDataSize, -contentLength)
+ newUploads := atomic.AddInt64(&fs.inFlightUploads, -1)
+ newSize := atomic.AddInt64(&fs.inFlightDataSize, -contentLength)
+ // Update metrics
+ stats.FilerInFlightUploadCountGauge.Set(float64(newUploads))
+ stats.FilerInFlightUploadBytesGauge.Set(float64(newSize))
fs.inFlightDataLimitCond.Signal()
}()