@@ -141,6 +141,17 @@ var (
141141 },
142142 []string {"code" , "reason" },
143143 )
144+ uploadAttempts = promauto .With (registry ).NewHistogramVec (
145+ prometheus.HistogramOpts {
146+ Name : "s3nd_upload_attempts" ,
147+ Help : "histogram of number of transfer attempts per file. Zero means the upload timed out while queued." ,
148+ NativeHistogramBucketFactor : 1.07 , // expected range of 0-5 attempts
149+ NativeHistogramZeroThreshold : 0.5 , // only 0 in zero bucket
150+ NativeHistogramMaxBucketNumber : 50 ,
151+ NativeHistogramMinResetDuration : time .Hour ,
152+ },
153+ []string {"code" , "reason" },
154+ )
144155)
145156
146157type S3ndHandler struct {
@@ -455,6 +466,7 @@ func (h *S3ndHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
455466 uploadQueuedSeconds .WithLabelValues (codeText , statusText ).Observe (task .UploadQueuedSeconds )
456467 uploadTransferSeconds .WithLabelValues (codeText , statusText ).Observe (task .UploadTransferSeconds )
457468 uploadTransferSizeBytes .WithLabelValues (codeText , statusText ).Observe (float64 (task .UploadSizeBytes ))
469+ uploadAttempts .WithLabelValues (codeText , statusText ).Observe (float64 (task .UploadAttempts ))
458470 }
459471
460472 status := RequestStatus {
0 commit comments