mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03:00
metrics: Add canceled requests (#11881)
Add metric for canceled requests
This commit is contained in:
@@ -74,6 +74,7 @@ type MetricName string
|
||||
const (
|
||||
total MetricName = "total"
|
||||
errorsTotal MetricName = "error_total"
|
||||
canceledTotal MetricName = "canceled_total"
|
||||
healTotal MetricName = "heal_total"
|
||||
hitsTotal MetricName = "hits_total"
|
||||
inflightTotal MetricName = "inflight_total"
|
||||
@@ -495,6 +496,15 @@ func getS3RequestsErrorsMD() MetricDescription {
|
||||
Type: counterMetric,
|
||||
}
|
||||
}
|
||||
func getS3RequestsCanceledMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: s3MetricNamespace,
|
||||
Subsystem: requestsSubsystem,
|
||||
Name: canceledTotal,
|
||||
Help: "Total number S3 requests that were canceled from the client while processing",
|
||||
Type: counterMetric,
|
||||
}
|
||||
}
|
||||
func getCacheHitsTotalMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
@@ -576,6 +586,7 @@ func getHealObjectsHealTotalMD() MetricDescription {
|
||||
Type: gaugeMetric,
|
||||
}
|
||||
}
|
||||
|
||||
func getHealObjectsFailTotalMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: healMetricNamespace,
|
||||
@@ -1077,6 +1088,13 @@ func getHTTPMetrics() MetricsGroup {
|
||||
VariableLabels: map[string]string{"api": api},
|
||||
})
|
||||
}
|
||||
for api, value := range httpStats.TotalS3Canceled.APIStats {
|
||||
metrics = append(metrics, Metric{
|
||||
Description: getS3RequestsCanceledMD(),
|
||||
Value: float64(value),
|
||||
VariableLabels: map[string]string{"api": api},
|
||||
})
|
||||
}
|
||||
return
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user