Add cluster audit metrics in metrics-v3 (#19514)

endpoint: /minio/metrics/v3/cluster/audit
metrics:
- failed_messages (counter)
- total_messages (counter)
- target_queue_length (gauge)
This commit is contained in:
Shireesh Anjal
2024-04-17 14:48:02 +05:30
committed by GitHub
parent 6df76ca73c
commit ca5fab8656
3 changed files with 75 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ const (
clusterUsageObjectsCollectorPath collectorPath = "/cluster/usage/objects"
clusterUsageBucketsCollectorPath collectorPath = "/cluster/usage/buckets"
clusterErasureSetCollectorPath collectorPath = "/cluster/erasure-set"
clusterAuditCollectorPath collectorPath = "/cluster/audit"
)
const (
@@ -218,6 +219,15 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
loadClusterErasureSetMetrics,
)
clusterAuditMG := NewMetricsGroup(clusterAuditCollectorPath,
[]MetricDescriptor{
auditFailedMessagesMD,
auditTargetQueueLengthMD,
auditTotalMessagesMD,
},
loadClusterAuditMetrics,
)
allMetricGroups := []*MetricsGroup{
apiRequestsMG,
apiBucketMG,
@@ -230,6 +240,7 @@ func newMetricGroups(r *prometheus.Registry) *metricsV3Collection {
clusterUsageObjectsMG,
clusterUsageBucketsMG,
clusterErasureSetMG,
clusterAuditMG,
}
// Bucket metrics are special, they always include the bucket label. These