Add cluster scanner metrics in metrics-v3 (#19517)

endpoint: /minio/metrics/v3/cluster/scanner
metrics:
 - bucket_scans_finished (counter)
 - bucket_scans_started (counter)
 - directories_scanned (counter)
 - last_activity_nano_seconds (gauge)
 - objects_scanned (counter)
 - versions_scanned (counter)
This commit is contained in:
Shireesh Anjal
2024-05-25 00:59:25 +05:30
committed by GitHub
parent 443c93c634
commit a591e06ae5
3 changed files with 99 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ const (
loggerWebhookCollectorPath collectorPath = "/logger/webhook"
replicationCollectorPath collectorPath = "/replication"
notificationCollectorPath collectorPath = "/notification"
scannerCollectorPath collectorPath = "/scanner"
)
const (
@@ -351,6 +352,18 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
loadClusterConfigMetrics,
)
scannerMG := NewMetricsGroup(scannerCollectorPath,
[]MetricDescriptor{
scannerBucketScansFinishedMD,
scannerBucketScansStartedMD,
scannerDirectoriesScannedMD,
scannerObjectsScannedMD,
scannerVersionsScannedMD,
scannerLastActivitySecondsMD,
},
loadClusterScannerMetrics,
)
loggerWebhookMG := NewMetricsGroup(loggerWebhookCollectorPath,
[]MetricDescriptor{
webhookFailedMessagesMD,
@@ -389,6 +402,7 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
clusterReplicationMG,
clusterConfigMG,
scannerMG,
auditMG,
loggerWebhookMG,
}