mirror of
https://github.com/minio/minio.git
synced 2025-12-08 16:53:11 -05:00
Add Audit target metrics (#16044)
This commit is contained in:
@@ -130,6 +130,7 @@ const (
|
||||
iamSubsystem MetricSubsystem = "iam"
|
||||
kmsSubsystem MetricSubsystem = "kms"
|
||||
notifySubsystem MetricSubsystem = "notify"
|
||||
auditSubsystem MetricSubsystem = "audit"
|
||||
)
|
||||
|
||||
// MetricName are the individual names for the metric.
|
||||
@@ -1567,6 +1568,43 @@ func getNotificationMetrics() *MetricsGroup {
|
||||
Value: float64(st.CurrentQueue),
|
||||
})
|
||||
}
|
||||
// Audit and system:
|
||||
audit := logger.CurrentStats()
|
||||
for id, st := range audit {
|
||||
metrics = append(metrics, Metric{
|
||||
Description: MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
Subsystem: auditSubsystem,
|
||||
Name: "target_queue_length",
|
||||
Help: "Number of unsent messages in queue for target",
|
||||
Type: gaugeMetric,
|
||||
},
|
||||
VariableLabels: map[string]string{"target_id": id},
|
||||
Value: float64(st.QueueLength),
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
Subsystem: auditSubsystem,
|
||||
Name: "total_messages",
|
||||
Help: "Total number of messages sent since start",
|
||||
Type: counterMetric,
|
||||
},
|
||||
VariableLabels: map[string]string{"target_id": id},
|
||||
Value: float64(st.TotalMessages),
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
Subsystem: auditSubsystem,
|
||||
Name: "failed_messages",
|
||||
Help: "Total number of messages that failed to send since start",
|
||||
Type: counterMetric,
|
||||
},
|
||||
VariableLabels: map[string]string{"target_id": id},
|
||||
Value: float64(st.FailedMessages),
|
||||
})
|
||||
}
|
||||
return metrics
|
||||
})
|
||||
return mg
|
||||
|
||||
Reference in New Issue
Block a user